[QGIS-trac] Re: [Quantum GIS] #3139: [Patch] Custom query for the
spatialite provider
Quantum GIS
qgis at qgis.org
Sun Dec 19 00:57:19 EST 2010
#3139: [Patch] Custom query for the spatialite provider
-------------------------------------+--------------------------------------
Reporter: brushtyler | Owner: esseffe
Type: patch | Status: reopened
Priority: minor: annoyance | Milestone: Version 1.7.0
Component: Data Provider | Version: Trunk
Resolution: | Keywords:
Platform_version: | Platform: All
Must_fix: Yes | Status_info: 0
-------------------------------------+--------------------------------------
Changes (by lmotta):
* status: closed => reopened
* milestone: Version 1.6.0 => Version 1.7.0
* priority: critical: causes crash or data corruption => minor:
annoyance
* version: => Trunk
* must_fix: No => Yes
* resolution: fixed =>
Comment:
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/3139#comment:3>
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