Subject Re: [firebird-support] Re: How can be stored procedure used in a SELECT
Author Helen Borrie
At 03:13 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.
>
>Thanks for quick response!
>
>Actually, I'm using currently my sp-s like this. I just wasn't sure
>if this is the correct way.
>
>The thing that concerns me, is unnecessary preformance loss when
>querying several output parameters from the same SP. When I use:
>
> select
> t.id,
> (select some_calculation from sp(t.id)) as x,
> (select related_calculation from sp(t.id)) as y
> (select yet_another_calculation from sp(t.id)) as z
> from sometable t
>
>then, i suppose, "sp" gets executed three times, although it
>computes all output parameters each time. Is there a better way to do
>it?
What I'd do is write an outer selectable procedure that does the whole
thing. This approach here is neither elegant nor speedy.

/heLen