Subject | RE: [firebird-support] Use the SP into Selects |
---|---|
Author | agung wibowo |
Post date | 2004-12-27T01:25:03Z |
>From: Fernando Buitrago [mailto:buitragolistas@...]Yes you can. ie. I have stored procedure like this :
>Sent: 26 Desember 2004 9:59
>To: firebird-support@yahoogroups.com
>Subject: [firebird-support] Use the SP into Selects
>Can I do this?
>Tell me more.
>Regards
>Fer
CREATE STORED PROCEDURE EXAMPLE_PROC(A INTEGER, B INTEGER)
RETURNS (C BIGINT)
AS
BEGIN
C=A*B;
END
Then you can do this : SELECT C FROM EXAMPLE_PROC(:A,:B) INTO :X;
If you want to get input parameter from another select query, than you can
make your stored procedure as subquery :
SELECT D,E,F,(SELECT C FROM EXAMPLE_PROC(TABLE1.D,TABLE1.E)) AS Z FROM
TABLE1 WHERE ..;
Merry christmast
With regards
Agung w
[Non-text portions of this message have been removed]