Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pl/sql

Status
Not open for further replies.

benjamenus

Programmer
Dec 3, 2001
157
GB
An app changes the value of STATUS. If the status is changed to K, I wish to override it. I've tried putting the following into the after-update trigger

if :new.STATUS='K' then
:new.STATUS='X';
end if;

Obviously you cannot do this, but how can achieve the desired result?

 
Try it as a BEFORE INSERT OR UPDATE trigger ..... think it should work. DaPi - no silver bullet
 
....and the trigger must be a FOR EACH ROW like this:

create or replace trigger XXXXXXXXX
before insert or update on TABLENAME
for each row
BEGIN
IF :NEW.STATUS = 'K' THEN
:NEW.STATUS := 'X';
END IF;
END;


regards
Allan
 
Thought I'd tried that, but obviously not! Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top