Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Triggers - Value Passing
>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-lReceived on Tue Mar 22 2005 - 07:31:27 CST