Subject | Re: [firebird-support] How can be stored procedure used in a SELECT |
---|---|
Author | Helen Borrie |
Post date | 2004-05-26T14:11:49Z |
At 01:48 PM 26/05/2004 +0000, you wrote:
one row at most AND it is a selectable SP then you could use a correlated
subquery, viz.
select
t.id,
(select some_calculation from sp(t.id))
from sometable t
If it returns multiple rows then I guess you need to write another
selectable sp that calls this one; and then select from this outer procedure.
p.s. Come back to the list if you don't understand the difference between a
selectable and an executable SP...
/heLen
>Hi!No; but how you do it depends on the procedure. If this SP returns only
>
>Is it possible to join a stored procedure into a query?
>
>I tried this:
>
> select
> t.id,
> sp.some_calculation
> from sometable t
> join some_sp sp on (sp.id = t.id)
>/* sp.id is procedure input param */
>
>but only got "parameter mismatch" error
>
> select
> t.id,
> sp.some_calculation
> from sometable t,
> some_sp (t.id)
>
>was syntax error.
>
>What is the correct way of using SP in a SELECT?
one row at most AND it is a selectable SP then you could use a correlated
subquery, viz.
select
t.id,
(select some_calculation from sp(t.id))
from sometable t
If it returns multiple rows then I guess you need to write another
selectable sp that calls this one; and then select from this outer procedure.
p.s. Come back to the list if you don't understand the difference between a
selectable and an executable SP...
/heLen