[Mapserver-users] Multiple DSN Problem

D'cruz,Steven [Ontario] Steven.D'Cruz at ec.gc.ca
Mon Jul 19 11:55:34 PDT 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>        <FONT SIZE=3D2 =
FACE=3D"Arial">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.</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"><OGRVRTDataSource></FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">        =
<OGRVRTLayer name=3D"Layer1Name"></FONT>

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

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

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

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

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

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

<BR><FONT SIZE=3D2 FACE=3D"Arial"></OGRVRTDataSource></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"><OGRVRTDataSource></FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">        =
<OGRVRTLayer name=3D"Layer2Name"></FONT>

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

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

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

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

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

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

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

<P><FONT SIZE=3D2 FACE=3D"Arial">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.</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