[QGIS-trac] Re: [Quantum GIS] #3030: Query Builder in Properties
produces "Query Failed"
Quantum GIS
qgis at qgis.org
Tue Sep 21 13:13:50 EDT 2010
#3030: Query Builder in Properties produces "Query Failed"
-----------------------------------------------------+----------------------
Reporter: alobo | Owner: jef
Type: bug | Status: closed
Priority: major: does not work as expected | Milestone: Version 1.6.0
Component: Vectors | Version: 1.5.0
Resolution: worksforme | Keywords:
Platform_version: ubuntu 9.10 | Platform: Debian
Must_fix: Yes | Status_info: 0
-----------------------------------------------------+----------------------
Changes (by jef):
* status: new => closed
* resolution: => worksforme
Old description:
> I select vector Properties/Query Builder
> and use the mouse to create a Query which
> results on error at executing the query.
> Tried several combinations with and without " and/or '
> The same procedure works fine with the Query Builder
> started from the Attribute Table.
>
> Also, other users confirm that this problem is
> not present under Windows
>
> Please see figures in
> https://sites.google.com/site/openfiles2/home/errorQueryBuilder.jpeg?attredirects=0&d=1
> and
> https://sites.google.com/site/openfiles2/home/AdvancedSearch.jpeg?attredirects=0&d=1
>
> Agus
New description:
I select vector Properties/Query Builder
and use the mouse to create a Query which
results on error at executing the query.
Tried several combinations with and without " and/or '
The same procedure works fine with the Query Builder
started from the Attribute Table.
Also, other users confirm that this problem is
not present under Windows
{{{"ID"='12'}}} in "subset" of a shape file produced an message box with
"An error occured when executing the query", while {{{ID=12}}} finds a
matching feature in the attribute table.
Agus
--
Comment:
The expression you enter in the attribute table (and field calculator) are
search string expression, that are QGIS specific and are evaluated
internally.
The expressions you enter in the vector properties are different and are
provider specific. These are evaluated by the provider (or it's
datasource).
E.g. unlike in search strings you have the opportunity to enter more
complex where clauses for postgres and spatialite layers (eg. call postgis
functions, exists clauses etc) and those might even be evaluated much
quicker, other providers (like the delimited text provider) might not even
support subset strings or the query options might be format specific (like
in the OGR provider).
Also note that the provider specific options may vary with different
versions of the datasource (ie. version of PostGIS/SpatiaLite/OGR/GDAL
etc). That might be why you see different behaviour between Linux and
Windows.
For me using {{{ID=2}}} on a shape file with an integer ID attribute works
fine.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/3030#comment:1>
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