Why error ORA-24338 and SP2-0625
700074Jun 1 2011 — edited Jun 1 2011There must be something I am doing wrong but I can't figure it out. I have a stored procedure like the following (this is a simplified version). The query out of the Proc runs without any errors and the procedure appears to run correctly (I get a "PL/SQL procedure successfully completed" message and I show no errors), but when I try to print the output I get the errors shown on the subject line of this thread.
The simplified Stored Proceedure is:
IS
Subno schemaname.Tablename.columnname%TYPE;
Cursor Purge IS
SELECT schemaname.Tablename.columnname
FROM schemaname.Tablename
WHERE (schemaname.Tablename.columnname='44933');
BEGIN
OPEN Purge;
LOOP
FETCH Purge INTO Subno;
EXIT WHEN Purge%NOTFOUND;
END LOOP;
Close Purge;
end;
I then try to view the results with the following lines and I get the errors:
set serveroutput on;
variable Purge refcursor;
exec schema.StoredProcName;
print Purge;
This seems very simple but there must be something I am missing. Any help would be appreciated.