How can we Get the Updated Rows? ie, There is 100s of Rows i
updated the Rows who have salary 5000. then i want to select
the Updated Rows. How can we achieve it?

Answer Posted / sudipta santra

create table t1 as select * from emp;
truncate table t1;

create or replace trigger tri_t1
before update on emp
for eachrow
begin
insert into t1
values(old.empno,old.ename,old.job,old.hiredate,old.sal,
old.comm,old.deptno);

end;
after create trigger
then if u update then the old updated values will be kept
in t1 table.

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you write a subquery?

517


What is the use of pl/sql table?

553


Is inner join same as self join?

578


How many types of triggers exist in pl/sql?

561


Which is faster view or stored procedure?

500






How do I run a query in pl sql developer?

560


How delete all data from all tables in sql?

534


What is Materialized View? In What Scenario we Use Materialized View?

8515


What are aggregate and scalar functions?

521


What is foreign key in sql with example?

511


how can we destroy the cookie? : Sql dba

555


Explain what is a column in a table?

570


What are the limitations of sql express?

524


What is the use of function "module procedure" in pl/sql?

665


What are the benefits of pl sql?

524