Subject Re: [firebird-support] Re: How to call a STORED PROCEDURE in SQL statement : select ProcA(col1) from ..
Author Martijn Tonies
> Thanks for the quick feedback.
>
> When you say that a procedure is NOT a function, you forgot that what
> is called "STORED PROCEDURE" in FIREBIRD can actually returns values
> like a standard programming language function:
>
> CREATE PROCEDURE procA (inputPar INTEGER)
> RETURNS (outputPar INTEGER)
> AS BEGIN
> ...
> END
>
> And you call it
>
> EXECUTE PROCEDURE procA(25) RETURNING_VALUES var1;

Actually, RETURNS can hold multiple returning values (output parameters)
while in any language, a function only returns a single result value. So
it's
not at all the same as a function that, for example, can be called like:

var1 = procA(25);

like any built in function or UDF.


> FIREBIRD would gain flexibility if we could create functions based on
> PSQL avoiding the need to rely on non-portable and potentially
> dangerous UDF.

Agreed. Stored Functions have been long on my list of wanted features,
but as I don't do the roadmap for Firebird, I can't help you when or how
they are implemented.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com