Hello,
I have a cursor for update and I would like to save all original values to the log file before updating them. Is there any way to loop over all the selected columns in cursor and print name-value pairs. Something like
declare
cursor c_dept is select deptno,dname,loc from dept for update;
begin
for r_d in c_dept loop
--print here name-value pairs for each column in opened cursor
for c in c_dept.columns loop
dbms_output.put_line('Column name' || c.name);
dbms_output.put_line('Column value' || c.value);
end loop;
update dept set dname = dname || '' where current of c_dept;
end loop;
end;
Thanks a lot,
Pavel
edit: also to get a data type of a given column would be nice to eventually skip clobs, blobs, xmltypes...and other similar columns