FWIW: years ago, an early SQL std. for distributed queries used
dotted notation for everything (e.g., 
somehost.somecatalog.someschema.sometable.somecolumn).
I don't know if thats still a part of the std or not...but having fiddled around
with a similar concept, I concur with the '[EMAIL PROTECTED]'
as a better, more obvious (and likely easier to safely parse) syntax.

One potential gotcha to lookout for: SQL Server (MSFT and Sybase) use '@'
in valid names (either system objects or procedures, can't recall which)...
so you may need to be cautious with the parsing...I think I've only
ever seen that at the beginning of an object name, so you should be
able to trap it.

Dean Arnold
Presicient Corp.
www.presicient.com

----- Original Message ----- 
From: "Jeff Zucker" <[EMAIL PROTECTED]>
Cc: "dbi-users" <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 1:57 PM
Subject: Re: RFC: SQL Extensions for SQL::Statement [Long]


> Bart Lateur wrote:
>
> >On Wed, 04 Jun 2003 09:15:28 -0700, Jeff Zucker wrote:
> >
> >
> >
> >> For per-table connections
> >> -------------------------
> >>     CONNECT TO '$dsn1' AS tbl1
> >>     CONNECT TO '$dsn2' AS tbl2
> >>
> >>
> >
> >Euh... you connect to a database, not to a table, no?
> >
>
> Well, yes and no.  The point of these, as distinct from a $dbh
> connection is that they are per-table connections.  One will use a
> single AnyData $dbh to connect to multiple tables each of which may
> reside in a different database, in a different rdbms, in a different
> location.  So I feel it is important to somehow emphasize that these are
> not the same kind of connection as we usually talk about in DBI.  Well,
> ok, under the hood they are going to be $dbhs and you will be able to
> address them, but for the purposes of the SQL syntax they behave
> differently.
>
> Still, I bow to the collective wisdom and will follow Tim's (and yours
> and Dean's) advice to use CONNECT TO to refer to connections.  Gosh you
> guys are picky.  You probably won't like my new SELECT syntax that does
> a delete either.  :-)
>
> > FWIW, MySQL allows the syntax
> > SELECT * FROM database.table
>
> Well ODBC has something similar with catalog and schema thrown in with
> the possibility that they are not all in the same rdbms or same
> location.  Oracle uses the [EMAIL PROTECTED] format where link is a
> heterogeneous database.
>
> > Both databases, the one you connect to, and the one mentioned here,
> > must (?) reside on the same MySQL server, though. It's the only way I
> > expect it to behave sanely, anyway.
>
> Bart, you should know by now that sanity is not one of my core values :-).  But 
> you're right, in
most cases something like this (which will be quite ordinary in DBD::AnyData) looks 
looney:
>
>   SELECT $cols FROM [EMAIL PROTECTED] JOIN [EMAIL PROTECTED] WHERE ...
>
>
> -- 
> Jeff
>
>
>
>
>

Reply via email to