Using FORALL with Part of a Collection
DROP TABLE employees_temp CASCADE CONSTRAINTS PURGE;
CREATE TABLE employees_temp
AS
SELECT *
FROM employees;
DECLARE
TYPE numlist IS VARRAY(10) OF NUMBER;
depts NUMLIST := Numlist(5,10,20,30,50,55,57,60,70,75);
BEGIN
FORALL j IN 4..7 -- use only part of varray
DELETE FROM employees_temp
WHERE department_id = Depts(j);
COMMIT;
END;
/
0 comments:
Post a Comment