PL/SQL 使用 SQL%ROWCOUNT 的例子

开始

VARIABLE rows_deleted varchar2(30)



DECLARE

  v_empno emp_cpy.empno%TYPE:=7900;

BEGIN

  DELETE FROM emp_cpy

  WHERE empno=v_empno;

  

  :rows_deleted:=(SQL%ROWCOUNT || 'row deleted.');

END;

/

PRINT rows_deleted

运行结果:

anonymous block completed

ROWS_DELETED

-------------

1row deleted.

结束

你可能感兴趣的:(pl/sql)