Subject AW: [firebird-support] Join with SP?
Author Alexander Gräf
This will quite ressource intensive. It would be much better to restructure the whole thing:

SELECT A.FLD1, A.FLD2,
(SELECT CONVERTED FROM SP1(A.FLD1)),
(SELECT CONVERTED FROM SP2(A.FLD2)) FROM TBL1 A;

Regards, Alex



-----Ursprüngliche Nachricht-----
Von: Alexandre Benson Smith [mailto:iblist@...]
Gesendet: Donnerstag, 25. November 2004 03:26
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] Join with SP?


Bjoern Reimer wrote:

>Hi,
>
>
> I have a Stored Procedure converting some data and want to join with
> some other data from a regular select of another table
>
> Is it possible?
>
> SELECT A.FLD1, A.FLD2, SP.FLD1, SP.FLD2 FROM TBL1 A JOIN
> MYSP(A.FLD3) SP ON SP.ID = A.ID
>
>
> The message I get is
> --
>The cursor identified in the update or delete statement is not positioned on a row.
>no current record for fetch operation.
> --
>
> Update? Delete? There is no Update nor Delete in the SP....
>
>
>
>
>
> Bjoern
>
>--
>SOFTbaer --- reimer@... --- www.softbaer.de
>
>
Hi !

Use a left join, this will force the table to be fetched before the SP....

SELECT A.FLD1, A.FLD2, SP.FLD1, SP.FLD2
FROM TBL1 A
LEFT JOIN MYSP(A.FLD3) SP ON SP.ID = A.ID


see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br



------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/67folB/TM
--------------------------------------------------------------------~->


Yahoo! Groups Links