[Catalyst] How do you structure multi-table DBIx queries?

Dennis Daupert ddaupert at sbcglobal.net
Tue Jul 25 03:40:47 CEST 2006


I have a number of tables that contain foreign keys to other tables;
I need to be able to do selects on multiple tables, specifying 
particular columns in particular tables.

So far, while combing the DBIx examples, I haven't found a way to do 
something like the query below. How would I do this?

SELECT quotes.id, quotes.quote, categories.category, users.fname, users.lname
FROM quotes
INNER JOIN categories
ON quotes.category = categories.id
INNER JOIN users
ON quotes.author = users.id;

I'm really trying to wrap my head around the perl data structure way of 
representing SQL statements, but the light bulb hasn't switched on yet.
I've been looking for a guiding set of rules as to when to use a hash,
when to use an anonymous array, etc. Is there such?

best,

/dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060724/8e7db2fb/attachment.htm 


More information about the Catalyst mailing list