commas in CONNECTION string cause MapServer to fail

Mark Adams Mark.Adams at DPRA.COM
Thu Apr 20 08:19:05 PDT 2006


I did see that bug, however it seemed to be specifically about quotation marks, whereas my example is failing on commas - a much more common problem with SQL I think.

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


-----Original Message-----
From: Szekeres Tamás [mailto:szekeres.tamas at freemail.hu] 
Sent: April 20, 2006 11:06 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Cc: Mark Adams
Subject: Re: commas in CONNECTION string cause MapServer to fail



There is a bug in connection with this problem

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1549

However it has not been fixed yet as far as I know.

Best Regards

Tamas Szekeres



On Thu, 20 Apr 2006 09:37:44 -0500, Mark Adams
<Mark.Adams at DPRA.COM> wrote:

>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
>
> 
>
>




_______________________________________________________________________________
Hogyan szerezz új állást? Regisztrálj, állítsd be a feltételeket, és naponta új, neked megfelelő ajánlatok
érkeznek emailcímedre. Jobline Állásposta: http://ad.adverticum.net/b/cl,1,6022,98196,159883/click.prm



More information about the MapServer-users mailing list