[gdal-dev] Use of "LIKE" in OGR layer attribute filters

Frank Warmerdam warmerdam at pobox.com
Mon Jun 21 17:02:43 EDT 2010


On Mon, Jun 21, 2010 at 4:52 PM, Chris Bailey
<chris.bailey at gtri.gatech.edu> wrote:
>
> We are using OGRLayer SetAttributeFilter to implement some search
> capabilities.  One feature that we want to allow is using the SQL "Like"
> operand in the where clause to allow wildcard searches or searches on
> partial fields.
>
> The documentation says that "Like" is not supported but it appears to work
> on memory data sources and data sources implemented with Database backends
> (like PostGIS).  Is there any way to determine which drivers support the SQL
> Like statement as an attribute filter?
>
> I believe the other way we could achieve the same functionality would be to
> use the ExecuteSQL command on the data source, do all drivers support the
> "standard" SQL syntax including Like?

Chris,

It appears that LIKE is supported in the general OGR SQL
implementation.  If you can be specified about what docs
say otherwise, I can correct them.

So, I think you will find that all the non-RDBMS datasources
have the same level of LIKE support as the MEM driver.
Presumably the RDBMS drivers are passing the request
through to the RDBMS and to the extent that it complies
with the SQL standard the LIKE operator will work.

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


More information about the gdal-dev mailing list