
Using SQL%ROWCOUNT
DROP TABLEemployees_temp
CASCADE CONSTRAINTS PURGE;
CREATE TABLE employees_temp
AS
SELECT *
FROM employees;
DECLARE
mgr_no NUMBER(6) := 122;
BEGIN
DELETE FROM employees_temp
WHERE manager_id = mgr_no;
dbms_output.Put_line('Number of employees deleted: '
||To_char(SQL%ROWCOUNT));
END;
/
Output :-
Number of employees deleted: 8
PL/SQL procedure successfully completed.

0 comments:
Post a Comment