| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Trigger
Try writing a function, as an autonomous transaction to do the sum for you:
Create or replace FUNCTION x(in_id_portfolio
PORTFOLIOZUSAMMENSETZUNG.ID_PORTFOLIO%Type)
RETURN NUMBER
AS
var_gewichtung Number;
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
select nvl(sum(GEWICHTUNG),0) into var_gewichtung from
PORTFOLIOZUSAMMENSETZUNG WHERE ID_PORTFOLIO = in_id_portfolio;
COMMIT;
RETURN var_gewichtung;
END ;
Might have to put the function into a package for it to work - it's been awhile since I used it and I don't remember.
>
Received on Mon Nov 12 2001 - 09:31:18 CST
![]() |
![]() |