Friday, 22 May 2015

Reading Oracle data with PyQGIS gives "identifier is not long" error


Do you have any idea how load Oracle spatial data to QGIS with using the PyQGIS? Is it possible? I try:


uri = QgsDataSourceURI()
uri.setConnection("*host*", "1521", "*database*", "*username*", "*password*")
sql = "(SELECT fid, geom FROM target.ms_ft_bh095_v)"
uri.setDataSource("",sql,"GEOM","","fid")
layer = QgsVectorLayer(uri.uri(), "test", "oracle")

The error message is: ORA-00972: identifier is not long. But FID max value is cca 20 000. Is Oracle driver correct with this syntax? Ms_ft_bh095_v is view in this moment.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...