commas in CONNECTION string cause MapSe rver to fail

Stephane Lessard LESSARDST at DFO-MPO.GC.CA
Thu Apr 20 14:01:58 EDT 2006


Hi Mark,
 
It has to be a syntax error. I use commas all the time.  Could you provide
the whole virtual layer definition?
 
Stephane


  _____  

De : UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] De la
part de Mark Adams
Envoyé : 20 avril 2006 10:38
À : MAPSERVER-USERS at LISTS.UMN.EDU
Objet : [UMN_MAPSERVER-USERS] commas in CONNECTION string cause MapServer to
fail



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/82311d84/attachment.html


More information about the mapserver-users mailing list