[gdal-dev] OGR2OGR - Define output naming from concatenated
queries from a DB
abhay.menon at gmail.com
Thu Aug 7 05:30:36 EDT 2008
On Thu, Aug 7, 2008 at 12:23 PM, D <eloquence2 at gmail.com> wrote:
> I have a question about the usage of OGR2OGR in defining an ESRI Shapefile
> output name. I am exporting Spatial data from Oracle Spatial (11g) from a
> single table to an ESRI Shapefile and would like to get the following naming
> syntax for my Shapefile:
> [select distinct FIELD1 from SHEMA.TABLE][select distinct FIELD2 from
> SHEMA.TABLE][fixed value -> 01]
> .. the output would look like
> The naming parts/chunks that are concatenated here are actually queries in
> the source database (Oracle).
> Any examples (sample scripts, procedures) or hints on how to implement
> this, would be very helpful.
> Best regards,
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
I don't think it is possible using ogr2ogr.exe, you will need to write a
small programme to do so.
Sorry I have not written any script yet on such a issue. But you could what
you could do is.
Open a recordset and from the desired name in select statement
select [select distinct FIELD1 from SHEMA.TABLE] || [select distinct FIELD2
from SHEMA.TABLE] || 01 from DUAL
and then pass this into the command line parameter as string
ogr2ogr.exe -f "ESRI Shapefile" <string from database result>.shp
"OCI:xxxxxxx/xxxxxxx at dbname" -sql <select queries that you want the output
and execute this thru shell or command prompt.
Hope this helps...!!!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev