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

2012-10-11 Thread Etienne Tourigny
try enclosing the column with single or double quotes?

On Tue, Oct 9, 2012 at 5:35 PM, Gabriel Fusca
gabrielfu...@suremptec.com.ar wrote:

 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.03, 3895521.90) - (2039227.59, 7591083.24)
 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,100.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
 gabrielfu...@suremptec.com.ar
 http://www.suremptec.com/


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


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

2012-10-09 Thread Gabriel Fusca
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.03, 3895521.90) - (2039227.59, 7591083.24)
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,100.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
gabrielfu...@suremptec.com.ar
http://www.suremptec.com/
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev