Hi,<br><br>I'm trying to access a point data table using MapServer through OGR VRT driver but I'm having errors.<br><br>My data table is at SQL Server 2000 and I already created a system dns for this database.<br><br>If I run:
<br>$ ogrinfo ODBC:myuser/mypassword@MYDSN -sql "SELECT * FROM PointTable WHERE themonth > 10"<br>this works fine<br><br>But when I try in MapServer:<br><br> LAYER<br> CONNECTION "<OGRVRTDataSource>
<br> <OGRVRTLayer name='pts'><br> <SrcDataSource>ODBC:myuser/mypassword@MYDSN</SrcDataSource><br> <SrcSQL>SELECT PointTable.* FROM PointTable WHERE themonth > 10</SrcSQL><br>
<GeometryField encoding='PointFromColumns' x='Long' y='Lat'/><br> <GeometryType>wkbPoint</GeometryType><br> </OGRVRTLayer><br></OGRVRTDataSource>"<br> CONNECTIONTYPE OGR
<br> DATA "pts"<br> NAME "ptsodbc"<br> STATUS DEFAULT<br> TYPE POINT<br> CLASS<br> COLOR 255 0 0<br> SIZE 6<br> SYMBOL "sym_basic"
<br> END<br> END<br clear="all"><br>Then I got:<br>/* -----<br>
msDrawMap(): Image handling error. Failed to draw layer named 'ptsodbc'. <br>
msOGRFileNextShape(): OGR error. SetAttributeFilter() not supported on ExecuteSQL() results. <br>
msEvalContext: Expression parser error. Failed to parse context <br>
msyyparse(): Expression parser error. syntax error <br>--- */<br><br>I only was able to filter data at this point table using FILTER and FILTERITEM keywords at mapfile, but only using regular expressions . Logical expressions does not show any point.
<br><br>Is that something wrong at my connection string or is this a bug to be solved using GDAL CVS ?<br><br>best,<br><br>-- <br>Eduardo Patto Kanegae<br><a href="http://www.webmapit.com.br">http://www.webmapit.com.br</a>