Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Trigger

Re: Trigger

From: DStevens <dstevens_at_navidec.com>
Date: Mon, 12 Nov 2001 08:31:18 -0700
Message-ID: <3BEFEB46.48A88395@navidec.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US