Hi,
I have a view that (among other things) calls a function to perform a big calculation. I want to have 2 columns containing the net and gross of this calculation.

At the moment, I am doing it like this:

E.g. Create or replace view a_view as
select
a_package.calc1 (val1, val2, 'Net') AS NetResult,
a_package.calc1 (val1, val2, 'Gross') AS GrossResult
from
a_table;

But, this means I am doing the same calculation twice.
How can I do this with only 1 call to calc1?

I know I can use a procedure to return > 1 value, but is it possible to get them to appear as different columns in the view?

Any ideas?

Thanks,
Tim