[gdal-dev] [ OGR SQL: Excecuting select where column name starts with "_" SO: Windows 7, GDAL/OGR 1.9.x

Gabriel Fusca gabrielfusca at suremptec.com.ar
Tue Oct 9 13:35:56 PDT 2012


Hi,

I´m getting a sql parsing error when I tried to execute a query to a
shapefile where column name starts with "_".

When i execute a query like : ogrinfo Provincias.shp -sql "SELECT * FROM
Provincias WHERE tipo = 1"

INFO: Open of `Provincias.shp'
      using driver `ESRI Shapefile' successful.
Layer name: Provincias
Geometry: Line String
Feature Count: 21
Extent: (309062.030000, 3895521.900000) - (2039227.590000, 7591083.240000)
Layer SRS WKT:
PROJCS["500K",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_84",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",1000000.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",-64.0],
    PARAMETER["Scale_Factor",1.0],
    PARAMETER["Latitude_Of_Origin",-90.0],
    UNIT["Meter",1.0]]
ID: String (1.0)
_tipo_Area: Integer (10.0)
_desc_Area: String (1.0)
tipo: Integer (10.0)
OGRFeature(Provincias):29
  ID (String) = 0
  _tipo_Area (Integer) = 1
  _desc_Area (String) = (null)
  tipo (Integer) = 1
  LINESTRING (873405.76 7463549.34,873313.54 7463695.39,872765.09
7465104.71,872
623.98 7465495.26)

But when i want to execute a query like "SELECT * FROM Provincias WHERE
_tipoArea = 1"


> ogrinfo Provincias.shp -sql "SELECT * FROM
WHERE _tipo_Area = 1"
INFO: Open of `Provincias.shp'
      using driver `ESRI Shapefile' successful.
ERROR 1: SQL Expression Parsing Error: syntax error


Any ideas on how to get around this?

Best regards,

-- 
Gabriel Fusca
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
gabrielfusca at suremptec.com.ar
http://www.suremptec.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20121009/7be36719/attachment.html>


More information about the gdal-dev mailing list