Subject Re: [firebird-support] stored procedure as function
Author Thomas Steinmaurer
> FB2:
> can i use a stored procedure as a function in a select statement?
> f.e.:
> SELECT EmplId, Salary, SP1(Salary)

select
t1.emplid
, t1.salary
, (select returnsalary from sp1(t1.salary)) as returnsalary
from
table1 t1

> where SP1 is created as:
>
> CREATE PROCEDURE SP1 (Salary INTEGER)
> RETURNS (ReturnSalary INTEGER)
> AS
> BEGIN
> ReturnSalary = 2*Salary; /* actualt some more complex calculation
> with Salary */
> END

A SUSPEND is missing before the END statement:


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