pls-00225, subprogram or cursor reference '%S' is out of scope.
Means that there is a problem resolving a object reference or variable name in the plsql program.
Check for duplicate variable declarations, or objects on the sys, system and the user schema, for any possible conflicts.
Select object_name, object_type, owner from dba_objects where object_name like '%'; should
help you identify the different objects existent in your system and the different schemas with the same name and that may be causing the reference conflict.
I also saw this out there on the web. http://www.edhanced.com/ask-mred/?q=node/view/53. So it may be that Oracle thinks you want to use the built in LOG function. By putting the userid in front, Oracle resolves the name to a different object.
Pete is right. I reproduced your error and it went away when I changed the package name to ERROR_PKG.
btw, possibly it's just a dummy example but the "errorlog" procedure doesn't seem to log anything. And it seems to throw away any error stack you had, for example:
2 RAISE_APPLICATION_ERROR(-20000, 'We have no bananas');
4 WHEN OTHERS THEN
6 'Error Error',
8 'Check your code',
10 'Check your code');
-20000Check your code
ERROR at line 1:
ORA-20001: Check your code
ORA-06512: at "WILLIAMR.ERROR_PKG", line 17
ORA-06512: at line 5
The error stack contained "ORA-20000: We have no bananas" until you called errorlog, when you lost the original stack (SQLERRM).
Also, why is "raisecode" VARCHAR2 and not INTEGER or PLS_INTEGER?
I would make "ssqlcode" an integer as well since I don't think you will need decimal places.