commas in CONNECTION string cause MapServer to fail

Mark Adams Mark.Adams at DPRA.COM
Thu Apr 20 10:37:44 EDT 2006


Hi all,

 

We're working on an application that uses a virtual spatial layer coming
from an Oracle database using WKT geometry. For performance and
presentation reasons, we are setting the CONNECTION string dynamically
based on the user's selected parameters on a query form. The CONNECTION
is being set by including the OGR virtual layer definition in-line, such
as:

 

CONNECTION "<OGRVRTDataSource>

    <OGRVRTLayer name='Reference_Query'>

        <SrcDataSource>ODBC:system/normin at normin_dev</SrcDataSource> 

            <SrcSQL>SELECT * FROM MINFWHSE_P1.MINFT_WH2_REFER_REFERENCE
WHERE MINFWHSE_P1.MINFT_WH2_REFER_REFERENCE.C_REFER_REFERENCE_NBR IS NOT
NULL</SrcSQL>

            <GeometryType>wkbPolygon</GeometryType> 

            <GeometryField encoding='WKT' field='GEOMETRY'/> 

    </OGRVRTLayer>

</OGRVRTDataSource>"

 

The above example works fine. However, when we include commas in the
SrcSQL element, such as "SELECT FIELD1,FIELD2 FROM TABLE1,TABLE2",
mapserver crashes with:

 

"

[MapServer Error]: msOGRFileOpen(): Open failed for OGR connection
`<OGRVRTDataSource>

    <OGRVRTLayer name='Reference_Query'>

        <SrcDataSource>ODBC:system/normin at normin_dev</SrcDataSource> 

            <SrcSQL>SELECT
MINFWHSE_P1.MINFT_WH2_REFER_REFERENCE.C_REFER_REFERENCE_NBR'.

Parse error at EOF, not all elements have been closed,

starting with SrcSQL

"

 

Is this behaviour expected, i.e. are commas disallowed in the MAP file,
and if so is there a way to escape them? I can put the exact same string
in an OVF file and set the CONNECTION to that file, and then it works,
so I know there is nothing wrong with the string itself.

 

Thanks.

 

------------------------------

Mark Adams

Senior Analyst & Project Manager

Cuesta Systems (DPRA Canada)

5230 South Service Road

Burlington, ON L7L 5K2

Phone: 905-333-4544 x14

Fax: 905-333-0455

Email: mark.adams at dpra.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060420/6684423d/attachment.html


More information about the mapserver-users mailing list