<div style="font-family: arial; font-size: 14px;">Thanks for the quick reply.</div><div style="font-family: arial; font-size: 14px;"><br></div><div style="font-family: arial; font-size: 14px;"><br></div>
<div class="protonmail_signature_block" style="font-family: arial; font-size: 14px;">
    <div class="protonmail_signature_block-user">
        Pierre</div>

            <div class="protonmail_signature_block-proton protonmail_signature_block-empty">

            </div>
</div>
<div style="font-family: arial; font-size: 14px;"><br></div><div class="protonmail_quote">
        ------- Original Message -------<br>
        Le mercredi 4 mai 2022 à 09:45, Seth G <sethg@geographika.co.uk> a écrit :<br><br>
        <blockquote class="protonmail_quote" type="cite">
            <div>Hi,<br></div><div><br></div><div>In the LAYER METADATA set:<br></div><div><br></div><div>"gml_types"   "auto"<br></div><div><br></div><div>See <a href="https://mapserver.org/ogc/wfs_server.html#layer-object" rel="noreferrer nofollow noopener" target="_blank">https://mapserver.org/ogc/wfs_server.html#layer-object</a><br></div><div><br></div><div>Seth<br></div><div><br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:<a href="https://geographika.net" rel="noreferrer nofollow noopener" target="_blank">https://geographika.net</a><br></div><div class="signature">twitter: @geographika<br></div></div><div><br></div><div><br></div><div>On Wed, May 4, 2022, at 3:28 PM, PE Lord via MapServer-users wrote:<br></div><blockquote style="" id="qt" type="cite"><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);">Hi there!<br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);">I've got a lot of fields stored as <span style="background-color:rgb(255, 255, 255);display:inline !important;">character/text </span>but their contents are integers/numbers.<br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);">Ex: In my DB (postgresql), I have tableA with fieldA. FieldA is declared as a <span>character(2) but the content of rows are numbers... i.e. 71</span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span>The issue here is when I filter my data (QGIS or my web app) :</span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><div><span>...?</span><br></div><div><span>SERVICE=WFS&</span><br></div><div><span>REQUEST=GetFeature&</span><br></div><div><span>VERSION=2.0.0&</span><br></div><div><span>TYPENAMES=ms:tableA&</span><br></div><div><span>STARTINDEX=0&COUNT=1000&</span><br></div><div><span>SRSNAME=urn:ogc:def:crs:EPSG::4326&</span><br></div><div><span>FILTER=</span><br></div><div><span><fes:Filter xmlns:fes="<a href="http://www.opengis.net/fes/2.0" rel="noreferrer nofollow noopener" target="_blank">http://www.opengis.net/fes/2.0</a>" xmlns:gml="<a href="http://www.opengis.net/gml/3.2" rel="noreferrer nofollow noopener" target="_blank">http://www.opengis.net/gml/3.2</a>"></span><br></div><div><span> <fes:And></span><br></div><div><span>  <fes:BBOX></span><br></div><div><span>   <fes:ValueReference>geometry</fes:ValueReference></span><br></div><div><span>   <gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"></span><br></div><div><span>    <gml:lowerCorner>40.77839999999999776 -87.96420000000000528</gml:lowerCorner></span><br></div><div><span>    <gml:upperCorner>51.88969999999999771 -68.37210000000000321</gml:upperCorner></span><br></div><div><span>   </gml:Envelope></span><br></div><div><span>  </fes:BBOX></span><br></div><div><span>  <fes:PropertyIsEqualTo xmlns:fes="<a href="http://www.opengis.net/fes/2.0" rel="noreferrer nofollow noopener" target="_blank">http://www.opengis.net/fes/2.0</a>"></span><br></div><div><span>   <fes:ValueReference>FieldA</fes:ValueReference></span><br></div><div><span>   <fes:Literal xmlns:fes="<a href="http://www.opengis.net/fes/2.0" rel="noreferrer nofollow noopener" target="_blank">http://www.opengis.net/fes/2.0</a>">71</fes:Literal></span><br></div><div><span>  </fes:PropertyIsEqualTo></span><br></div><div><span> </fes:And></span><br></div><div><span></fes:Filter></span><br></div><div><span></span><br></div></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span>Mapserver return this error </span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span><span style=""><span style="font-family:monospace;" class="font"><span style="font-size:13px;" class="size"><ows:ExceptionText></span></span></span><span style="color:rgb(0, 0, 0);"><span style="font-family:monospace;" class="font"><span style="font-size:13px;" class="size">msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs</span></span></span><span style=""><span style="font-family:monospace;" class="font"><span style="font-size:13px;" class="size"></ows:ExceptionText></span></span></span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span><span style=""><span style="font-family:monospace;" class="font"><span style="font-size:13px;" class="size"> </span></span></span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);">To fix this issue, I know that I must declare gml_<span style="background-color:rgb(255, 255, 255);display:inline !important;">fieldA</span>_type<span> "Character".</span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span>Here the question: There is a method to automatically declare the type of all of thems?</span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span>The real issue about this question is that I have to handle near a thousand of layers, each of them containning a lot of fields! It's a scale issue!</span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span>Thanks</span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span>Pierre</span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><span></span><br></div><div style="font-family:arial;font-size:14px;color:rgb(34, 34, 34);"><br></div><div>_______________________________________________<br></div><div>MapServer-users mailing list<br></div><div><a href="mailto:MapServer-users@lists.osgeo.org" rel="noreferrer nofollow noopener" target="_blank">MapServer-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer nofollow noopener" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div>
        </blockquote><br>
    </div>