[Mapserver-users] Multiple DSN Problem

D'cruz,Steven [Ontario] Steven.D'Cruz at ec.gc.ca
Mon Jul 19 14:55:34 EDT 2004


This is a multi-part message in MIME format.

------_=_NextPart_001_01C46DC1.F89BB2B9
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi there,

	I was wondering if anyone has any experience with executing
select statements using two different DSNs simultaneously.  For my work,
I require functionality similar to the following: "select a.* from
tablename1 a, tablename2 b where a.id=3Db.id and b.filter=3D't'" , where
tablename1 and tablename2 are from 2 DIFFERENT DSNs.  Both DSNs are to
be accessed via a realtime connection to a MS Access 2000 database from
a linux host via the FREETDS drivers.  I currently have both DSNs
working independently in 2 test layers (with no errors) using the
required fields.  Here's the .ovf file used for the selection queue from
the MS Access 2000 databases.

Database1:
-----------------
<OGRVRTDataSource>
        <OGRVRTLayer name=3D"Layer1Name">
=20
<SrcDataSource>ODBC:UserName/Password at DSN1Name</SrcDataSource>
                <SrcSQL>select statement here</SrcSQL>
                <GeometryType>wkbPoint</GeometryType>
                <GeometryField encoding=3D"PointFromColumns" =
x=3D"longitude"
y=3D"lati
tude"/>
        </OGRVRTLayer>
</OGRVRTDataSource>

Database2:
----------------
<OGRVRTDataSource>
        <OGRVRTLayer name=3D"Layer2Name">
=20
<SrcDataSource>ODBC:UserName/Password at DSN2Name</SrcDataSource>
                <SrcSQL>select statement here</SrcSQL>
                <GeometryType>wkbPoint</GeometryType>
                <GeometryField encoding=3D"PointFromColumns" =
x=3D"longitude"
y=3D"lati
tude"/>
        </OGRVRTLayer>
</OGRVRTDataSource>


What I require is a .ovf file which allows for 2 SrcDataSource(s).  I've
attempted to add an additional <SrcDataSource> tag followed by the
connection information to the second database to the first .ovf file,
however I consistently get no points found... even if I don't use the
data.  Are there any known ways of accomplishing this task?  If not,
I'll probably have to extract the necessary fields from Layer2 in a file
on the local machine, and then use either javascript or php to filter
the results from Layer1.  Any comments, suggestions, and related
questions would be greatly appreciated.  Also, as I'm unsure whether
this would be considered more of a Chameleon or Mapserver problem, I've
posted it to both mailing lists.
Steven D'Cruz
Steven.D'Cruz at ec.gc.ca
(GIS) Web Developer
Environment Canada


------_=_NextPart_001_01C46DC1.F89BB2B9
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.6487.1">
<TITLE>Multiple DSN Problem</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi there,</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">I was wondering if anyone has any experience with =
executing select statements using two different DSNs =
simultaneously.&nbsp; For my work, I require functionality similar to =
the following: &quot;select a.* from tablename1 a, tablename2 b where =
a.id=3Db.id and b.filter=3D't'&quot; , where tablename1 and tablename2 =
are from 2 DIFFERENT DSNs.&nbsp; Both DSNs are to be accessed via a =
realtime connection to a MS Access 2000 database from a linux host via =
the FREETDS drivers.&nbsp; I currently have both DSNs working =
independently in 2 test layers (with no errors) using the required =
fields.&nbsp; Here's the .ovf file used for the selection queue from the =
MS Access 2000 databases.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Database1:</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">-----------------</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;OGRVRTDataSource&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;OGRVRTLayer name=3D&quot;Layer1Name&quot;&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;SrcDataSource&gt;ODBC:UserName/Password at DSN1Name&lt;/SrcDataSource&gt=
;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SrcSQL&gt;select statement =
here&lt;/SrcSQL&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GeometryField =
encoding=3D&quot;PointFromColumns&quot; x=3D&quot;longitude&quot; =
y=3D&quot;lati</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">tude&quot;/&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;/OGRVRTLayer&gt;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;/OGRVRTDataSource&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Database2:</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">----------------</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;OGRVRTDataSource&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;OGRVRTLayer name=3D&quot;Layer2Name&quot;&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;SrcDataSource&gt;ODBC:UserName/Password at DSN2Name&lt;/SrcDataSource&gt=
;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SrcSQL&gt;select statement =
here&lt;/SrcSQL&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GeometryField =
encoding=3D&quot;PointFromColumns&quot; x=3D&quot;longitude&quot; =
y=3D&quot;lati</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">tude&quot;/&gt;</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;/OGRVRTLayer&gt;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;/OGRVRTDataSource&gt;</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">What I require is a .ovf file which =
allows for 2 SrcDataSource(s).&nbsp; I've attempted to add an additional =
&lt;SrcDataSource&gt; tag followed by the connection information to the =
second database to the first .ovf file, however I consistently get no =
points found&#8230; even if I don't use the data.&nbsp; Are there any =
known ways of accomplishing this task?&nbsp; If not, I'll probably have =
to extract the necessary fields from Layer2 in a file on the local =
machine, and then use either javascript or php to filter the results =
from Layer1.&nbsp; Any comments, suggestions, and related questions =
would be greatly appreciated.&nbsp; Also, as I'm unsure whether this =
would be considered more of a Chameleon or Mapserver problem, I've =
posted it to both mailing lists.</FONT></P>

<P ALIGN=3DCENTER><B><I><FONT SIZE=3D2 FACE=3D"Arial">Steven =
D'Cruz</FONT></I></B></P>

<P ALIGN=3DCENTER><B><I><FONT SIZE=3D2 =
FACE=3D"Arial">Steven.D'Cruz at ec.gc.ca</FONT></I></B></P>

<P ALIGN=3DCENTER><B><I><FONT SIZE=3D2 FACE=3D"Arial">(GIS) Web =
Developer</FONT></I></B></P>

<P ALIGN=3DCENTER><B><I><FONT SIZE=3D2 FACE=3D"Arial">Environment =
Canada</FONT></I></B><I></I></P>

</BODY>
</HTML>
------_=_NextPart_001_01C46DC1.F89BB2B9--



More information about the mapserver-users mailing list