Subject | Re: [firebird-support] How to call a STORED PROCEDURE in SQL statement : select ProcA(col1) from ... |
---|---|
Author | Martijn Tonies |
Post date | 2005-12-28T15:06:29Z |
Hi there,
select col1, col2, (select myoutputparam from ProcA(col3))
from tableA
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
> Firebird STORED PROCEDUREs cannot be called directly in the SELECTBecause a PROCEDURE it's not a FUNCTION.
> part of a SQL statement.
>
> For example, a procedure ProcA(arg1) that returns an integer, cannot
> be called in the follwing way:
>
> select col1, col2, ProcA(col3) from tableA; -- INVALID
>
> I find this a real limitation. What is the reason for such a
> behaviour?
>Will FIREBIRD V2 remove this limitation?No, because a PROCEDURE it's not a FUNCTION.
> Is there a workaround in V1.5.x based only on the SELECT syntax?If the procedure is select-able (has SUSPEND in it), you can do:
select col1, col2, (select myoutputparam from ProcA(col3))
from tableA
> If not, is an UDF (with low portability between OS) the only possibilty?Not if your UDF needs access to your tables/views/etc...
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