DB2 Version 9.7 for Linux, UNIX, and Windows

GET_ROUTINE_SAR procedure

Read syntax diagramSkip visual syntax diagram
>>-GET_ROUTINE_SAR---------------------------------------------->

>--(--sarblob--,--type--,--routine-name-string--+-------------------+--)-><
                                                '-,--hide-body-flag-'      

The schema is SYSFUN.

The GET_ROUTINE_SAR procedure retrieves the necessary information to install the same routine in another database server running the same level on the same operating system. The information is retrieved into a single BLOB string representing an SQL archive file.

Authorization

EXECUTE privilege on GET_ROUTINE_SAR procedure

sarblob
An output argument of type BLOB(3M) that contains the routine SAR file contents.
type
An input argument of type CHAR(2) that specifies the type of routine, using one of the following values:
  • 'P ' for a procedure
  • 'SP' for the specific name of a procedure
routine-name-string
An input argument of type VARCHAR(257) that specifies a qualified name of the routine. If no schema name is specified, the default is the CURRENT SCHEMA when the routine is processed. The routine-name-string cannot include double quotation marks (").
hide-body-flag
An input argument of type INTEGER that specifies (using one of the following values) whether or not the routine body should be hidden when the routine text is extracted from the catalogs. Valid values are:
0
Leave the routine text intact. This is the default value.
1
Replace the routine body with an empty body when the routine text is extracted from the catalogs.

The qualified name of the routine is used to determine which routine to retrieve. The routine that is found must be an SQL routine. Not using a specific name may result in more than one routine, and an error is raised (SQLSTATE 42725). If this occurs, the specific name of the required routine must be used.

The SAR file must include a bind file, which may not be available at the server. If the bind file cannot be found and stored in the SAR file, an error is raised (SQLSTATE 55045).