CREATE OR REPLACE PACKAGE serial_package
AS
CURSOR emps_cur
IS
SELECT * FROM hr.employees;
END serial_package;
Package created.
Open the Cursor, Don't Close It
BEGIN
OPEN serial_package.emps_cur;
END;
Statement processed.
Try to Open the Cursor AGAIN....
BEGIN
OPEN serial_package.emps_cur;
END;
ORA-06511: PL/SQL: cursor already open
Now Add SERIALLY_REUSABLE Pragma
CREATE OR REPLACE PACKAGE serial_package
AS
PRAGMA SERIALLY_REUSABLE;
CURSOR emps_cur
IS
SELECT * FROM hr.employees;
END serial_package;
Package created.
Open the Cursor, Don't Close It
BEGIN
OPEN serial_package.emps_cur;
END;
Statement processed.
Open the Cursor AGAIN, No Problem!
BEGIN
OPEN serial_package.emps_cur;
END;
Statement processed.