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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Triggers - Value Passing

RE: Triggers - Value Passing

From: Christian Antognini <Christian.Antognini_at_trivadis.com>
Date: Tue, 22 Mar 2005 13:27:28 +0100
Message-ID: <2CF83791A616BB4DA203FFD13007824A02144184@MSXVS02.trivadis.com>

>My question , If this statement put inside a trigger .
>Then how would a trigger pass the returning value to
>my application ?

The returning clause should not be used inside the trigger but in your = application...

SQL> create table t (n number);

SQL> create sequence s;

SQL> create or replace trigger t before insert on t for each row   2 begin
  3 select s.nextval into :new.n from dual;   4 end;
  5 /

SQL> variable n number

SQL> insert into t values (null) returning n into :n;

SQL> print n

         N


         1

SQL> insert into t values (null) returning n into :n;

SQL> print n

         N


         2

HTH
Chris

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Mar 22 2005 - 07:31:27 CST

Original text of this message

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