Hi All!

I am using the GDAL/OGR functions to query a shapefile. This is a sample code I have been successfully running so far:

   OGRDataSource *poDS = OGRSFDriverRegistrar::Open(
   "some/path/to/myshapefile.shp" );
   OGRLayer *poLayer = poDS->ExecuteSQL( "select * from myshapefile",
   NULL, NULL );
   // ...
   // fetching result features from "poLayer"
   // ...
   poDS->ReleaseResultSet( poLayer );
   OGRDataSource::DestroyDataSource(poDS);


As you can see, I am currently using the OGR SQL dialect, as I am passing NULL as the third parameter of the OGRDataSource::ExecuteSQL function.

Now I am trying to extend the SQL syntax to be able to use the OGR SQLite dialect. I have successfully recompiled GDAL 1.11.1 with SQLite support (version 3.8.5) but when I try to execute the same sample code (passing "SQLITE" as the 3rd argument of the OGRDataSource::ExecuteSQL function) I am getting the following error:

   In ExecuteSQL(): sqlite3_prepare(select * from myshapefile): no such
   table: myshapefile


What is the table name that contains the shapefile features that I can use in my SQL queries?

Thank you!

--
Pierluigi Guasqui
Software Engineer

Applied Coherent Technology Corporation (ACT)
www.actgate.com

_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to