Thursday, January 09, 2014

ORA-04042

If you try to grant execute access to a non-existent procedure, you get an ORA-04042. You can see what I mean in the example below, which I ran in an Oracle 9 database:
 
SQL> create procedure proc1 is
  2  begin
  3  null;
  4  end;
  5  /
 
Procedure created.
 
SQL> create user fred identified by bloggs
  2  /
 
User created.
 
SQL> grant execute on proc2 to fred
  2  /
grant execute on proc2 to fred
                 *
ERROR at line 1:
ORA-04042: procedure, function, package, or package
body does not exist
 
SQL> grant execute on proc1 to fred
  2  /
 
Grant succeeded.
 
SQL>

No comments: