Subject RE: [firebird-support] How to Join to a Selectable Stored Procedure
Author Rick Debay
I didn't know you could pass parameters from other tables in to a stored
procedure inside a query. This will be very useful.
BTW, what error will you get if you don't use an outer join?

-----Original Message-----
[] On Behalf Of Alexandre Benson
Sent: Wednesday, July 19, 2006 4:10 PM
Subject: Re: [firebird-support] How to Join to a Selectable Stored



You could join to SP's the join condition will vary acording to what you
procedure returns.

if your SP returns only a sub-set that is already related to the Detail
table, then you just could use 1=1 as the join condition.

but use left join to force the table to be processed before the SP
otherwise you will get an error, something like this:

SELECT t.Description, d.CurrentAmount, sp.YTDAmount FROM Detail d INNER
JOIN PayType t ON t.hKey = d.hPayType LEFT JOIN sp_YTDAmt(d.hCheck,
d.hPayType) sp ON 1=1

see you !

Alexandre Benson Smith
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil