[gdal-dev] Ogrinfo how to execute remotelly a query on oracle.

Andrea Peri aperi2007 at gmail.com
Tue Sep 12 23:05:04 PDT 2017


Hi,
I'm try-ing to execut this query on an oracle dbms
select SUM(AREA) from dbti_user.rt_dati_terreni

To do this I need to use ogrinfo.

So I try t execute this ogrinfo call:

ogrinfo "OCI:username/password@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS
= (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521)))(CONNECT_DATA =
(SID =xxxxxx)))" -sql "select SUM(AREA) from
dbti_user.rt_dati_terreni"

But the ogrinfo report an error:

I'm not well understand but it seem due to the ogrinfo that try to
execute the query programmatically insted of ask to the oracle to do
the SUM.

Is possibile set ogrinfo to send the query sql to the oracle executing
it on the dbms ?

I report the log fragment with the error.

INFO: Open of `OCI:username/password@(DESCRIPTION = (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT =
1521)))(CONNECT_DATA = (SID =xxxxxx)))'
      using driver `OCI' successful.

Layer name: select SUM(AREA) from dbti_user.rt_dati_terreni
Geometry: None
ERROR 1: COMMIT transaction failed: disk I/O error
ERROR 1: Transaction already established
ERROR 1: sqlite3_step() failed:
  attempt to write a readonly database (8)
ERROR 1: Unable to write feature 19999 from layer select COD_COM, SEZ,
SEZ_URBANA, ZONA, FOGLIO, NUMERO, SUBALTERNO, CATEGORIA, CLASSE,
CONSISTENZA, UNITA_MISURA_CONSISTENZA, SUPERFICIE, RENDITA, INDIRIZZO,
CIVICO, TOPONIMO, PROT_ULTIMO_AGG from dbti_user.rt_dati_fabbricati.

ERROR 1: Terminating translation prematurely after failed
translation from sql statement.
ERROR 1: Transaction not established
Warning 1: Value '2405950.3164' of field select SUM(AREA) from
dbti_user.rt_dati_terreni.SUM(AREA) parsed incompletely to integer
2405950.
Feature Count: 1
Layer SRS WKT:
(unknown)
SUM(AREA): Integer (0.0)


Many thx.

-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the gdal-dev mailing list