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