Couple of questions...

"Aaron Freeman" <[email protected]> Tue, 20 Apr 2004 09:46:39 -0700
Newsgroups gmane.comp.python.modeling
Message-ID <20040420164648.YGFQ15011.fed1rmmtao11.cox.net@halcyon>
(1) Is there a debug flag somewhere that dump all SQL queries to the
console?

(2) How are nested joins accomplished?

For example, in the AuthorBooks schema, lets assume there is another table
called publisher that has a 1-M relationship with books, like so (sorry
about the formatting):

............................................................................
.............
.+-----------+.(0,1)..............(0,*).+-------+.(0,*)..............(0,1).+
-----------+.
.|..Writer...|<-author----------books->>|.Book..|<<-books-------publisher->|
.Publisher.|.
.|-----------|.(nullify)......(cascade).|-------|..........................|
-----------|.
.|.lastName..|..........................|.title.|..........................|
.bizName...|.
.|.firstName.|..........................|.price.|..........................|
.location..|.
.|.age.......|.(0,1)....................+-------+..........................+
-----------+.
.|.birthday..|<-pygmalion--+................................................
.............
.+-----------+.(nullify)...|................................................
.............
 
.....|....................|.................................................
............
......+--------------------+................................................
.............
............................................................................
.............

How would I get writers by publisher?

More specifically, is there an elegant way to do a nested join in a single
query, or do I just have to do a single writer-book join and then iterate
over the resultset for the second join?

Code examples would be great!

Thanks for your time.

-Aaron




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click