Subject RE: [firebird-support] SP to Retrieve Parent and Child Table Rows At once
Author Mercea Paul
Try



Select (fields that you want) from receipt r

Join receiptline l on l.receiptid=r.receiptid

Join receiptpayment p on p.receiptlineid=l.receiptlineid
--(if you have receipted in receiptpayment, put that to)

WHERE (put your condition)



Regards,

Paul



From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Muthu Annamalai
Sent: Saturday, September 13, 2008 1:13 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] SP to Retrieve Parent and Child Table Rows At
once



Greetings,

I have three tables as follows

Receipt
ReceiptLine
ReceiptPayment

One Receipt row can have multiple receiptline rows and multiple
ReceiptPayment rows.

Now I use three stored procedures to retrieve data from each table. It
is becoming very slow when I have to retreive more records.

How would I write one stored procedure that will retrieve all three.

Thanks!

Muthu Annamalai





[Non-text portions of this message have been removed]