Update record based on previous record [message #636775] |
Sat, 02 May 2015 07:38 |
|
rohit_shinez
Messages: 139 Registered: January 2015
|
Senior Member |
|
|
Hi Guys,
I having two tables where in i will be inserting the records based on input parameter passed in my stored procedure and i would like to update those successful records which were inserted into another table with flag notification
for eg
create or replace procedure (a in number, b in number , c out varchar2) is
begin
insert into Table
select col1,col2 from Table_2 where col = a, col2 = b ;
count:=SQL%ROWCOUNT;
if count>0
then
update Main_table set flag = 'S' where col = a, col2 = b ;
else
c:='failed';
end if
end;
/
is there any alternative way to update in main_table with success flag as 'S' based on those records only succseefully inserted in Table
|
|
|
|
|
|
|
|
|
|