[Mapserver-users] Multiple DSN Problem

D'cruz,Steven [Ontario] Steven.D'Cruz at ec.gc.ca
Tue Jul 20 10:33:27 EDT 2004


Hi Frank,

	Thanks for the quick reply.  To answer your question, both
tables are on the same MS SQL server, however in different databases
(although they have key fields in common).  Basically, each table is a
member of a different System DSN.  Also of note is that although I've
been granted access to the contents of the database, I have no
administration privileges over the database.

Steven D'Cruz
Steven.D'Cruz at ec.gc.ca
(GIS) Web Developer
Environment Canada


-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Tuesday, July 20, 2004 9:49 AM
To: D'cruz,Steven [Ontario]
Cc: mapserver-users at lists.gis.umn.edu
Subject: Re: [Mapserver-users] Multiple DSN Problem


D'cruz,Steven [Ontario] wrote:
> 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=b.id and b.filter='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.

Steven,

Are the two tables you are interested in within the same MS-SQL
database? If so, you should be able to just do your join in a single
SrcSQL statement. Any SQL that the remote ODBC database supports can be
in the SrcSQL statement.

OGR SQL also has a built-in join syntax when you are working against
non-SQL enabled databases that allows accessing tables from different
datasources but that would be hard to make kick in when using stuff over
ODBC.

Best regards,

-- 
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the mapserver-users mailing list