Posted on 2005-02-26 21:47:05-08 by lucir
Join seem to implemented... Is it?

I've just tried DBD::AnyData.

My first effort was to parse 2 XML files and to inner join them. It worked well. Then I read documentation :) and saw that

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.

Both statements worked:

SELECT foo.id, foo.data, bar.data FROM foo INNER JOIN bar ON foo.id = bar.id
SELECT foo.id, foo.data, bar.data FROM foo, bar WHERE foo.id = bar.id

What does it mean? Is the subject already implemented in DBD-AnyData or the work is done by DBI module itself?

I use DBD-AnyData 0.08, DBI 1.47

Direct Responses: 157 | Write a response
Posted on 2005-02-27 00:26:21-08 by jzed in response to 154
Re: Join seem to implemented... Is it?
Hi Alexei,

I need to remove that from the documentation, it's no longer true. As you saw, DBD::AnyData does handle multiple tables in a single SQL statement now. Just an oversight in not updating the documentation.

The latest SQL syntax for DBD::AnyData will always be found in the SQL::Parser documentation that is part of the SQL::Statement distribution. AnyData gets all of its SQL abilities from SQL::Statement and SQL::Parser so keeping them up to date is important.

I'd prefer that most reports go to the dbi-users@perl.org mailing list, or directly to me, or as a bug report on rt.cpan.org. I can also often be found on PerlMonks as jZed. CPAN-forum is a great tool but as an author I already have all those other places I need to keep an eye on and I'd prefer not to have another.

Thanks again for writing,

--
Jeff (aka jZed)

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.