IBM Support

Java Stored Procedure: SQL0551 Not authorized to Object &1 in /QIBM/UserData/OS400/SQLLib/ function type *N

Troubleshooting


Problem

If the class file used by a Java Stored Procedure is not installed correctly, it can result in a SQL0551 error.

Resolving The Problem

Attempting to call a stored procedure written in Java might produce an error such as the following:

Message ID . . . . . . :   SQL0551       Severity . . . . . . . :   30      
Message type . . . . . :   Diagnostic                                        
Date sent  . . . . . . :   09/16/02      Time sent  . . . . . . :   10:09:57
                                                                             
Message . . . . :   Not authorized to object sample5.func in                
  /QIBM/UserData/OS400/SQLLib/Function type *N.                              
Cause . . . . . :   An operation was attempted on object sample5.donut in    
  /QIBM/UserData/OS400/SQLLib/Function type *N.  This operation cannot be    
  performed without the required authority.                                  
Recovery  . . . :   Obtain the required authority from either the security  
  officer or the object owner. If you are not authorized to a logical file,  
  obtain the authority to the based-on files of the logical file. Try the    
  operation again.                                                          
                                                                             
This message might be misleading. Another cause of the problem is that the class file is missing or in the incorrect directory.


In the error message, the create procedure incorrectly defined the EXTERNAL NAME as sample5.func. It references a class name of sample5 with a static function of func. If the class file is missing, the SQL0551 is reported. The sample5.class file must exist in the /QIBM/UserData/OS400/SQLLib/function directory or in a registered JAR file. If the class is part of a package, it must be in the appropriate subdirectory under the function directory. JAR files can be registered by using the JAR file stored procedures that are included with the SQLJ package. For more information, see the IBM i documentation, SQLJ procedures that manipulate JAR files.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and its affiliates.

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Historical Number

28102237

Document Information

Modified date:
19 December 2019

UID

nas8N1016840