Hi Brent,

I never worked with virtual data source but have some experience of OGR.

The original documentation of the format of OGR virtual data source is here:
http://www.gdal.org/ogr/drv_vrt.html

To my understanding, the way to specify a WHERE condition is by
writing the full ODBC query using the <SrcSQL> element in
<OGRVRTLayer> (instead of <SrcLayer>).
This way (OGR-level), the SQL is forwarded by OGR to the ODBC driver,
so quite low-level.


Jean-François Gigand


2011/2/16 <[email protected]>
>
> Hi,
>
> I'm looking to set up a mapfile with an inline ovf data source as described 
> in part 2 of section 5 at 
> http://mapserver.org/input/vector/VirtualSpatialData.html
>
> I'm also looking to embed an SQL in the ovf with a where clause, using 
> runtime variable substitution as described at 
> http://mapserver.org/cgi/runsub.html?highlight=variable
>
> The latter says that such runtime substitution is supported in the CONNECTION 
> & DATA fields within the LAYER object.
>
> I'm unclear as to how a where clause can be inserted in the ovf definition, 
> and am hoping that this will be in the CONNECTION or DATA fields, and is 
> amenable to runtime variable substitution.
>
> Basically with the URL including:                                         
> &job_id=23
> have an ovf where clause specified like:      ...                    where 
> job=%job_id%
>
>  thus from this
>
> have an ovf ODBC connection pass a where clause like:   and job_id=23 ..."
>
> This is connecting to an aspatial Oracle database returning up to 100 point 
> features from a table with X Y columns..
>
> Can anyone provide some hints on:
>
> 1. Is this possible?
> 2. How best to implement it?
>
>
> Thanks,
>
>    Brent Wood
>
>
>
> _______________________________________________
> mapserver-users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to