Subject | Re: How can be stored procedure used in a SELECT |
---|---|
Author | kimon_the_athenian2 |
Post date | 2004-05-26T15:13:57Z |
> one row at most AND it is a selectable SP then you could use acorrelated
> 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?
Aivar