ADMIN_INFO_SSID stored procedure

The SYSPROC.ADMIN_INFO_SSID stored procedure returns the name of the connected DB2® subsystem.

Begin general-use programming interface information.

Environment

ADMIN_INFO_SSID must run in a WLM-established stored procedure address space.

Authorization

To execute the CALL statement, the owner of the package or plan that contains the CALL statement must have one or more of the following privileges:

  • The EXECUTE privilege on the ADMIN_INFO_SSID stored procedure
  • Ownership of the stored procedure
  • SYSADM authority

Syntax

The following syntax diagram shows the SQL CALL statement for invoking this stored procedure:

>>-CALL--SYSPROC.ADMIN_INFO_SSID--(--subsystem-ID--,--return-code--,--message--)-><

Option descriptions

subsystem-ID
Identifies the subsystem ID of the connected DB2 subsystem.

This is an output parameter of type VARCHAR(4).

return-code
Provides the return code from the stored procedure. Possible values are:
0
The call completed successfully.
12
The call did not complete successfully. The message output parameter contains messages describing the error.

This is an output parameter of type INTEGER.

message
Contains messages describing the error encountered by the stored procedure. If no error occurred, no message is returned.

This is an output parameter of type VARCHAR(1331).

Example

The following C language sample shows how to invoke ADMIN_INFO_SSID:

 #include    <stdio.h>
 #include    <stdlib.h>
 #include    <string.h>

 /******************** DB2 SQL Communication Area ********************/
 EXEC SQL INCLUDE SQLCA;

 int main( int argc, char *argv[] )    /* Argument count and list    */
 {
   /****************** DB2 Host Variables ****************************/
   EXEC SQL BEGIN DECLARE SECTION;

   /* SYSPROC.ADMIN_INFO_SSID PARAMETERS                             */
   char        ssid[5];                /* DB2 subsystem identifier   */
   long int    retcd;                  /* Return code                */
   char        errmsg[1332];           /* Error message              */
   EXEC SQL END DECLARE SECTION;

   /******************************************************************/
   /* Call stored procedure SYSPROC.ADMIN_INFO_SSID                  */
   /******************************************************************/
   EXEC SQL CALL SYSPROC.ADMIN_INFO_SSID
                        (:ssid, :retcd, :errmsg);

   return(retcd);
 }

Output

The output of this stored procedure includes the following output parameters, which are described in Option descriptions:

  • subsystem-ID
  • return-code
  • message

End general-use programming interface information.