[ic] multi database query clarification
peter at pajamian.dhs.org
Wed Jan 19 04:07:06 UTC 2011
On 19/01/11 14:01, Jon Jensen wrote:
> On Tue, 18 Jan 2011, Paul Jordan wrote:
>> However, if I create a JOIN that spans this new table (in Database B)
>> and any table in Database A, there are problems. IC will only
>> recognize one table. The fix is to use the full dsn... FROM
>> databaseB.newtable AS foo, etc.
> That's a nonstandard MySQLism. Normal Perl DBI connections work for only
> a single database, and that's what Interchange assumes.
Right, which was what I was kind of trying to explain before, However,
IC does allow you to take advantage of this MySQL db "feature" of being
able to access other DBs in a query. Interchange does not, however, go
out of it's way to support this.
One way to think of this is that Interchange really only supports
accessing one table at a time. The fact that you can access multiple
tables in a single DB (or multiple tables across DBs with mysql) is a
feature of the DB, not of Interchange, and as said above, while IC does
not stop you from doing this, neither does it go out of it's way to
support it. If you're going to do this then you need to make sure that
the db handle for the primary table you're accessing can also access all
other tables in the same query, regardless of what other information
Interchange has to be able to access those tables separately.
> Interchange's database abstraction layer comes from a different era and
> it would be simpler for most purposes now if it defined connection
> handles separate from tables. But that's another discussion.
Yes, I agree, this would simplify IC's db layer quite a bit, however
this is one can of worms we have absolutely no hope of fixing now, we
are stuck with things the way they are.
More information about the interchange-users