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: OK Gurus - one to test you re Triggers

Re: OK Gurus - one to test you re Triggers

From: Anders Eriksson <anders_at_knowledgepartner.com>
Date: Tue, 17 Aug 1999 20:16:30 +0200
Message-ID: <37B9A6FD.6306CCC@knowledgepartner.com>


Hello Fraser,

Check if your trigger is firing on delete as well. When doing a delete you would not have any new value. If you want to use your trigger for delete also you would have to supply a check:
if inserting then
 ...
elsif updating then
 ...
end if;

Regards
Anders Eriksson

Fraser Boswell wrote:

> Sorry if this doesnt make sense to you, I havent quite got it myself.
> Say I have a cursor which holds all the fieldnames and I load the
> fieldname into a variable called colname.
> in a For Cursor Loop I want to reference each column from it's name in
> the colname
> So in the After Update query I want to write:
> IF :NEW.colname != :OLD.colname THEN -- field has been updated
> --etc
> END IF;
> except :NEW.colname gives me a bad bind variable error.
> How do you get round this. Dynamic SQL?
>
> help please? Thanks in advance
>
> Fraser


Received on Tue Aug 17 1999 - 13:16:30 CDT

Original text of this message

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