[Gdal-dev] SQL

Frank Warmerdam warmerdam at pobox.com
Fri Apr 11 09:00:02 EDT 2003


Krzysztof Chodak wrote:
> Would anyone be so kind and tell me what is wrong with such query:
> ogr2ogr Dolnośląskie miasta_granice -where "Wojewodztw like %Dolno%"
> It reports: ERROR 1: Syntax error, 2 extra tokens
> 
> Are "where" clauses supported for ESRI shapefiles?

Hi,

The string you are comparing to needs to be quoted.  Try using:

   ogr2ogr Dolnośląskie miasta_granice -where 'Wojewodztw like "%Dolno%"'

If you are doing this on windows the escaping rules may vary.

PS. I tried a similar where clause in Oracle and found I needed to quote
the string token used in the LIKE test as well.

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