Tuesday, June 19, 2018

Using cursor write a pl/sql code that if Coloumn Name(Sr.NO) is present into table Class A then insert those value into Table Class B - DBMS (Cursor)

declare
cursor abc(a number) is select * from classA;
rec abc%rowtype;
n number(5);
begin
n:=&n;
open abc(n);
loop
fetch abc into rec;
if n=rec.no
then
insert into classB values(n,rec.name);
end if;
exit when abc%notfound;
end loop;
end;

No comments:

Post a Comment