Frédéric Therrien wrote:
Hey guys, I'm using ogr to perform select statement in a database for a mapserver/gis. I would like to know something. Is it possible to build dynamic query ? Here is an example:

Select * from Table where field1 > X

Where X can vary depending on the query. I would like to use this feature for time display (display information since a date and this date can be feed by the user in the user interface).

Thx for you help.

Frédéric,

I don't know anything about your application, but of course it is
generally possible to do dynamic queries.  This would normally be
accomplished by assembling the query string dynamically in your
application before passing it to ExecuteSQL() or SetAttributeFilter().

Note that "OGR SQL" requires that the right side of any comparison be
a constant, so you can't compare two fields in a non-database datasource
(if that is what you were thinking).  You can do anything supported by
SQL in a real RDBMS.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [EMAIL PROTECTED]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to