Subject | Re: [firebird-support] stored procedure as function |
---|---|
Author | Thomas Steinmaurer |
Post date | 2006-11-19T13:17Z |
> FB2:select
> can i use a stored procedure as a function in a select statement?
> f.e.:
> SELECT EmplId, Salary, SP1(Salary)
t1.emplid
, t1.salary
, (select returnsalary from sp1(t1.salary)) as returnsalary
from
table1 t1
> where SP1 is created as:A SUSPEND is missing before the END statement:
>
> CREATE PROCEDURE SP1 (Salary INTEGER)
> RETURNS (ReturnSalary INTEGER)
> AS
> BEGIN
> ReturnSalary = 2*Salary; /* actualt some more complex calculation
> with Salary */
> END
CREATE PROCEDURE SP1 (Salary INTEGER)
RETURNS (ReturnSalary INTEGER)
AS
BEGIN
ReturnSalary = 2*Salary;
SUSPEND;
END
As heard at the conference, "real" stored functions or on the roadmap. ;-)
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com