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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Andrea Peri
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 àèìòù
-----------------
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Ogrinfo how to execute remotelly a query on oracle.

Even Rouault-2

On mercredi 13 septembre 2017 08:05:04 CEST Andrea Peri wrote:

> 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.

 

Andrea,

 

The error message shows sqlite3 being involved. Two hypothesis:

- either the error message doesn't relate to ogrinfo, but rather ogr2ogr converting from OCI to sqlite. And I think that must be the case here given the "Unable to write feature..." message

- either you added -dialect sqlite to your ogrinfo command line.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev