The REBIND_ROUTINE_PACKAGE procedure rebinds the package associated with an SQL procedure, routine, compiled function, or trigger. It is functionally equivalent to the REBIND command, except that it takes a procedure name, instead of a package name, as an argument. The REBIND_ROUTINE_PACKAGE procedure can be invoked from the command line or called from an application.
Explicitly rebinding the associated package does not revalidate the routine. Revalidate an invalid routine by using automatic revalidation or explicitly by using the ADMIN_REVALIDATE_DB_OBJECTS procedure. Routine revalidation automatically rebinds the dependent package.
There are two equally valid methods to invoke REBIND_ROUTINE_PACKAGE. The only difference between the two invocations is the method of specifying the routine name. In the first instance, the routine-name-string variable consists of identifier names separated by periods. In the second method, the routine is identified by separate values for each of the schema, module and name values.
Method 1:
>>-REBIND_ROUTINE_PACKAGE--(--type--,---------------------------> >--routine-name-string--,--options--)--------------------------><
Method 2:
>>-REBIND_ROUTINE_PACKAGE--(--type--,---------------------------> >--schema--,--module--,--name--,--options--)-------------------><
The schema is SYSPROC.
The qualified name of the routine is used to determine which routine to retrieve. The routine that is found must be an SQL routine; otherwise, an error is returned (SQLSTATE 428F7). If a specific name is not used, more than one routine may be found, and an error is returned (SQLSTATE 42725). If this occurs, the specific name of the required routine must be used.
Example 1: Rebind the package of routine UPDATE_EMPLOYEE using the RESOLVE, REOPT and APREUSE options.
Method 1:
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'P','UPDATE_EMPLOYEE','RESOLVE ANY REOPT ONCE APREUSE YES')
Method 2:
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'P','','','UPDATE_EMPLOYEE','RESOLVE ANY REOPT ONCE APREUSE YES')
Example 2: Rebind the package of routine UPDATE_EMPLOYEE with no options.
Method 1:
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'P','UPDATE_EMPLOYEE','')
Method 2:
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'P','','','UPDATE_EMPLOYEE','')
Example 3: Rebind the package of a compiled trigger.
Method 1:
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'T','DRICARD.MIN_SALARY','REOPT ALWAYS')
Method 2:
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'T','DRICARD','','MIN_SALARY','REOPT ALWAYS')
Example 4: Rebind the package of a compiled function using a three part name.
Method 1
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'F','DRICARD.MODULE.FUNCTION','REOPT ALWAYS')
Method 2
CALL SYSPROC.REBIND_ROUTINE_PACKAGE (
'F','DRICARD','MODULE','FUNCTION','REOPT ALWAYS')