[QGIS-trac] [Quantum GIS] #3356: Error when spatialite select
statement returns only one field
Quantum GIS
qgis at qgis.org
Sun Dec 19 22:10:27 EST 2010
#3356: Error when spatialite select statement returns only one field
---------------------------------------------------------+------------------
Reporter: brushtyler | Owner: brushtyler
Type: bug | Status: new
Priority: critical: causes crash or data corruption | Milestone: Version 1.7.0
Component: Data Provider | Version:
Keywords: | Platform_version:
Platform: All | Must_fix: Yes
Status_info: 0 |
---------------------------------------------------------+------------------
From lmotta (see #3139):
When in select statement have only the pkuid's column, the attributes's
table didn't showed the values of pkuid. Obs: The identify is OK. The
problem is the table of layer Otherwise (have others columns) all
attributes showed in table
Example with error(only pkuid): sql = "select t.id as pkuid,t.the_geom as
geometry from test t limit 10" uri = QgsDataSourceURI()
uri.setDatabase('/home/lmotta/bd_gis/spatialite/gis.sqlite')
uri.setDataSource(, '(%s)' % sql, 'geometry', , 'pkuid')
qgis.utils.iface.addVectorLayer(uri.uri(), "Select", 'spatialite')
Example correct (more columns): sql = "select t.id as pkuid, t.name,
t.the_geom as geometry from test t limit 10" ...
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/3356>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list