<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">This should help:<br>
      <br>
<a class="moz-txt-link-freetext" href="http://mapserver.org/cgi/runsub.html#default-values-if-not-provided-in-the-url">http://mapserver.org/cgi/runsub.html#default-values-if-not-provided-in-the-url</a><br>
      <br>
      /Lars S.<br>
      <br>
      Den 2017-03-14 kl. 19:38, skrev Stefanos Anastasiou:<br>
    </div>
    <blockquote
      cite="mid:1701886596.9571363.1489516719169@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:14px">
        <div id="yui_3_16_0_ym19_1_1489503002035_26426">Hi all.</div>
        <div id="yui_3_16_0_ym19_1_1489503002035_26426" dir="ltr">   I'm
          trying to perform a runtime substitution in MapServer. My
          mapfile snippet is the following: </div>
        <div id="yui_3_16_0_ym19_1_1489503002035_26426" dir="ltr"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26578"> VALIDATION </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26590">     
                "val_1" "^[0-9]+(\.[0-9]+)?$"      </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26591">     
                "val_2" "^[0-9]+(\.[0-9]+)?$"</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26592">     
                "val_3" "^[0-9]+(\.[0-9]+)?$"</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26593">     
                "val_4" "^[0-9]+(\.[0-9]+)?$"</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26598">     
           END</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26599">     
           METADATA</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26600">     
                  #various WMS parameters</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26607">     
            END</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26608">     
            TYPE line</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26609">     
            STATUS on</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26610">     
            CONNECTIONTYPE POSTGIS</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26611">     
            CONNECTION 'host=localhost port=5432 user=stefanos
          password=myPassword dbname=dbName'        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26613">     
            DATA "geom FROM (SELECT * FROM stored_function(%val_1%,
          %val_2%, %val_3%, %val_4%)) AS foo USING UNIQUE seq USING
          srid=2100"</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26613"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26613"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26613">If I
          pass the parameters in my url, everything works well. The
          problem occurs when I don't pass any parameter. The
          MS_ERROFILE gives me the following error:</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26613"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26776">Error
          (ERROR:  syntax error at or near "%"</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26777">LINE
          1: ...'hex') as geom,"seq" from (SELECT * FROM
          _a_route(%val_1%, %val_2%...</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778">     
                                                                       
                                                 ^</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778">It's
          necessary not to pass default values like  "default_val_1"
          "some_value"    because of a weird setup of my stored
          function.<br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778">Is
          there any way to fix this ? </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778">Thanks
          a lot...!!</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26778">-Stefanos</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26613"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1489503002035_26613"><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a></pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>