Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Output of a trigger statement

883611Dec 28 2011 — edited Dec 29 2011
Hi


I am trying to see the output of a simple update trigger program, but it seems its not getting fired or probably i dont know how to see its result .

If the trigger results in inserting data into another table ..i am getting such a result but not on the screen .

I have tried enabling the trigger and read forum too but i am not getting it at all

please help ..
create or replace trigger print_salary_changes
  BEFORE delete or insert or update OF SALARY on employees
  for each row
     when(new.job_id<> 'AD_PRES') 
  declare
      sal_diff number;
   BEGIN   
      sal_diff:=:new.salary - :old.salary;
      dbms_output.put(:new.last_name||',');
      dbms_output.put('olD SALARY='||:old.salary||',');
      dbms_output.put('nEW SALARY='||:new.salary||',');
      dbms_output.put('Difference'||sal_diff);

 end;
 /

TRIGGER print_salary_changes compiled
If i try to update i do get the updated rows but not the trigger result .
update employees
set salary= salary*1.07
where department_id in(10,20,90);
6 rows updated.


Thanks

Edited by: to_learn on Dec 28, 2011 3:33 PM
This post has been answered by Frank Kulash on Dec 28 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 26 2012
Added on Dec 28 2011
17 comments
13,136 views