Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Basic trigger help
Hallo Kram!
Corrected version below. You have to use the INTO-clause for the select.
after insert on db.delays
referencing
new as new
old as old
FOR EACH ROW
declare
n_Cgrno customer.cgrno%type := 0;
begin
select c.cgrno from customer c, ad a, delays d
into n_Cgrno
where a.adno=:NEW.ADNO and a.cus2no=c.cusno and d.adno=a.adno and d.vno=a.vno; if (n_Cgrno <> 100) then begin delete from delays where adno=:old.adno; end;
Hope this help's,
Stefan.
kram <kram_at_biosys.net> schrieb in im Newsbeitrag:
ECsC5.16387$tl2.1165436_at_bgtnsc07-news.ops.worldnet.att.net...
> Can any body help me with the following trigger?
> I is invalid as there is an error in the sql, but when I run this
separately
> it works.
>
> after insert on db.delays
> referencing
> new as new
> old as old
> FOR EACH ROW
> begin
> if (select c.cgrno from customer c, ad a, delays d
> where a.adno=:NEW.ADNO
> and a.cus2no=c.cusno
> and d.adno=a.adno
> and d.vno=a.vno); <> 100 then
> begin
> delete from delays where adno=:old.adno;
> end;
Received on Tue Oct 03 2000 - 18:14:47 CDT
![]() |
![]() |