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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TRIGGER

Status
Not open for further replies.

Nsan

MIS
Joined
Apr 30, 2003
Messages
13
Hi,

I need to create a trigger that will replace a value that has been inserted. If a negative number is inserted into a record how to change that value to a positive value.

create or replace trigger num_val
after insert of n_app on emp
begin
If n_app = ( a negative number)


 

Assuming your column is named n_app:

create or replace trigger num_val
after insert
on <TABLE NAME>
for each row
when new.n_app < 0
declare
begin
:new.n_app := abs(:new.n_app);
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top