Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Query that joins multiple tables using different keys

by Roger (Parson)
on May 15, 2007 at 03:24 UTC ( #615450=perlquestion: print w/replies, xml ) Need Help??

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

Dear monks, I have a question on Catalyst but I couldn't go onto the #Catalyst irc channel due to firewall permissions. Please enlighten me as I have pulled my hair for sometime trying to solve a simple problem.

I have three tables: user_contact, loan_details and loan_accepted. user_contact.userid(PK)->loan_details.userid(FK), and loan_details.itemid(PK)->loan_accepted.itemid(FK). I would like to perform a simple search across the tables, with the following SQL:
select a.loanid, d.itemid, u.userid, a.enddttime, u.companyid,d.interestt +ype from tbl_user_contact u, tbl_loan_accepted a, tbl_loan_details d where u.userid = d.userid and d.itemid = a.itemid and d.amount > 100000 ;
My Catalyst models are 'TblUserContact', 'TblLoanAccepted' and 'TblLoanDetails'.

Please advise on how to write the above joined query in Catalyst's DBIx::Class extension, with $c->Model('TblUserConact'), etc. Your help is greatly appreciated. Thanks.

Replies are listed 'Best First'.
Re: Query that joins multiple tables using different keys
by Limbic~Region (Chancellor) on May 15, 2007 at 13:41 UTC
    I am sorry that I can not help with your specific question but I can point you to some Catalyst resources that should not be an issue for you. The first is the Catalyst::Manual, the second is the Catalyst mail list, and the third is CGI:IRC. I do not advocate bypassing corporate security for nefarious purposes but setting up a http <-> irc proxy to a specific channel on a specific server for work related purposes is ok.*

    * It is morally ok by me. You should still make sure you are not violating corporate policy.

    Cheers - L~R

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://615450]
Approved by kyle
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2022-12-08 02:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found