Wednesday 4 May 2016

EXAMPLE FOR SQL%ROWCOUNT (IMPLICIT CURSORS)

declare
rows_affected char(4);
begin
update employee set salary = salary*0.15 where job='programmers';
rows_affected := to_char(sql%rowcount);
if sql%rowcount > 0 then
dbms_output.put_line(rows_affected || 'employee records modified successfully');
else
dbms_output.put_line('There are no employees working as programmers');
end if;
end;

No comments:

Post a Comment