S_Shrum has asked for the wisdom of the Perl Monks concerning the following question:

Currently, I'm using the DBD:AnyData driver with the DBI. (as if I was using it with something else...).

I understand the SQL side of this issue, but that's not the problem...

I believe (fingers-crossed / knock on wood / kiss the blarney stone / etc.) that I should be able to 'connect to' and 'join together' 2 (or more) flat file data sources relationally via the DBI, a properly structured SQL statement, and *any* DBD driver (stop me here if I'm wrong =8-D, but explain why in detail, pleaze).

I have gone thru the cheetah book (O'Reilly:Programming the Perl DBI) which shows you how to structure the SQL for a inner and outer join but I have yet to find any code examples in it using flat file data sources.

If you can point me to somewhere that has code in it that demonstrates how to acheive these sort of DB connections, point the way!

TIA

======================
Sean Shrum
http://www.shrum.net

  • Comment on How do I... Do relational DBI joins using 2 (or more) flat file data sources

Replies are listed 'Best First'.
Re: How do I... Do relational DBI joins using 2 (or more) flat file data sources
by impossiblerobot (Deacon) on Apr 08, 2002 at 13:50 UTC
    From the DBD::AnyData documentation:
    Currently only a limited subset of SQL commands are supported. Only a single table may be used in each command. This means That there are *no joins*, but see the section above on simulating joins.
    and
    DBD::AnyData does not currently support using multiple tables in a single SQL statement. However it does support using multiple tables and querying them separately with different SQL statements. This means you can simulate joins by creating two statement handles and using the values from the first handle as a lookup key for the second handle.

    I hope this helps. For more detail, see the documentation.

    Impossible Robot
Re: How do I... Do relational DBI joins using 2 (or more) flat file data sources
by perrin (Chancellor) on Apr 08, 2002 at 14:33 UTC