OGR Virtual problem with Where clause
Pagurek,Debbie [NCR]
Debbie.Pagurek at EC.GC.CA
Thu Mar 30 07:18:28 PST 2006
Try using single quotes instead of double quotes:
<SrcSQL>SELECT * FROM TestPolygon WHERE Name='Cosh'</SrcSQL>
D. Pagurek
-----Original Message-----
From: UMN MapServer Users List
[mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of James Perrins
Sent: Thursday, March 30, 2006 8:57 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] OGR Virtual problem with Where
clause
Hi,
I'm just experimenting with this - (just discovered it :-))
which looks great.
I'm calling from mapserver with the XML connection statement in
the map file (IIS5 + Mapserver 4.6.1)
I've been playing with MDB and SQL Server - both of which I can
get to plot points and polygons (with WKT)
In the examples below - KeyField is an Integer in the database
and Name is a text / nvarchar (50)
Plotting the whole layer works fine
<SrcSQL>SELECT * FROM TestPolygon</SrcSQL>
Using a filter on an integer field works fine
<SrcSQL>SELECT * FROM TestPolygon WHERE KeyField=1</SrcSQL>
But I just can't get it to filter using any other sort of where
clause - specifically text string e.g.
<SrcSQL>SELECT * FROM TestPolygon WHERE Name="Cosh"</SrcSQL>
I've tried a variety of syntaxes but no success - everything I
try returns something like:
SQL statement failed, or returned no layer result:
SELECT GEOMETRY FROM TestPolygon WHERE Name="Cosh"
Can anyone help me out ?
Have I got the syntax wrong - if so is there any doc that
details this ?
Looking at others questions they seem to have it working - do I
need to be careful of build versions?
Many Thanks
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060330/d0ead417/attachment.htm>
More information about the MapServer-users
mailing list