<div dir="ltr">Hi List,<br>
<br>
De following OGRVRT datasource is used to define a Mapserver layer on an ODBC connection to a MSACCESS tabel that contains x and y values. This works fine.<br>
<div><br></div><div>    CONNECTION "<OGRVRTDataSource><br>        <OGRVRTLayer name='kpxy'><br>            <SrcDataSource>ODBC:admin/admin@MyMSACCESSDatabase</SrcDataSource><br>            <SrcSQL>SELECT * FROM kpxy</SrcSQL>               <br>            <GeometryType>wkbPoint</GeometryType><br>            <LayerSRS>WGS84</LayerSRS>            <br>            <GeometryField encoding='PointFromColumns' x='x' y='y'/><br>        <Field name='kp_nr' type='String' /><br>        <Field name='kp_id' type='String' /><br>        <Field name='sort' type='String' /><br>        <Field name='x' type='Integer' /><br>        <Field name='y' type='Integer' /><br>        </OGRVRTLayer><br>    </OGRVRTDataSource>"<br></div><div><br></div>
Now we need a WFS on this, and we should be able to select a record based on a field value.<br><br><div>
A WFS-Filter might look like <Filter><PropertyIsEqualTo><PropertyName>kp_nr</PropertyName><Literal>06864</Literal></PropertyIsEqualTo></Filter><br>
<br>
The error is described by the following <div><br>
<ServiceException code="NoApplicableCode" locator="mapserv"><br>
  msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed<br>
  msOGRFileNextShape(): OGR error. Type mismatch or improper type of arguments to = operator.<br>
  </ServiceException><br>
<br>
So, the kp_nr field is not of type integer in the underlying database. The Literal states 06864, which at least looks like an int.</div><div><br>
Take a look at the datasource again.<br><br></div><div>The fields kp_id and kp_nr are defined as String, not Integer. </div><div>I take it that Mapserver cannot determine the correct type from the Literal which looks like an int</div><div><br></div><div>But now I explicitly defined the type in the MAP file.</div><div><br></div><div>        <Field name='kp_nr' type='String' /><br></div><div><br></div><div><br></div><div>I proved this case by looking up a Literal on the same property that actually contains a real Character. No errors</div><div><br></div><div>So Mapserver tries to 'see' the datatype instead of looking it up. I can imagine you need to do that if you cannot access the database but in this case the datatype of this field is given. No need to gamble datatypes between records...</div><div><br></div><div>Should i file a bug report?</div><div><br></div><div><br></div><div>Regards, Huub</div><div><br></div><div><br></div></div></div>