Re: TRIGGERS

  • From: Vitalis Jerome <vitalisman@xxxxxxxxx>
  • To: "Scott, Jim H - VSCM" <scott.jim@xxxxxxxxxxxxx>
  • Date: Wed, 18 May 2005 16:37:40 +0200

On 5/18/05, Scott, Jim H - VSCM <scott.jim@xxxxxxxxxxxxx> wrote:
> That's good, but this flavor uses less resources (the evaluation is
> pushed up out of the pl/sql block):
>=20
> SQL> create trigger trig_t before insert on t for each row
>   2  when (:new.a is null)
>   3  begin
>   4  select seq_a.nextval into :new.a from dual;
>   5  end;
>   7  /

Hi Jim,

I see what you meant, but...

SQL> drop trigger trig_t;

Trigger dropped.

SQL> create trigger trig_t before insert on t for each row
when (:new.a is null)
begin
select seq_a.nextval into :new.a from dual;
end;
/  2    3    4    5    6
when (:new.a is null)
      *
ERROR at line 2:
ORA-25000: invalid use of bind variable in trigger WHEN clause
--
//www.freelists.org/webpage/oracle-l

Other related posts: