PL/SQL Cursor attributes

Submitted by:Andery Smith

Date added:21 January, 2012

Category:PL SQL

PL/SQL Block that uses implicit cursor attributes as below example code.

Tags: cursor attributes

Code Snippet:

DECLARE  var_rows number(5);
BEGIN
UPDATE emp
SET salary = salary + 2000;
IF SQL%NOTFOUND THEN
dbms_output.put_line('None of the salaries where updated');
ELSIF SQL%FOUND THEN
var_rows := SQL%ROWCOUNT;
dbms_output.put_line('Salaries for ' || var_rows || 'employees are updated');
END IF;
END;
 
 

Comments