IBM Books

Administrative API Reference

sqlegins - Get Instance

Returns the value of the DB2INSTANCE environment variable.

Authorization

None

Required Connection

None

Version

sqlenv.h

C API Syntax



/* File: sqlenv.h */
/* API: Get Instance */
/* ... */
SQL_API_RC SQL_API_FN
  sqlegins (
    _SQLOLDCHAR * pInstance,
    struct sqlca * pSqlca);
/* ... */
 

Generic API Syntax



/* File: sqlenv.h */
/* API: Get Instance */
/* ... */
SQL_API_RC SQL_API_FN
  sqlggins (
    struct sqlca * pSqlca,
    _SQLOLDCHAR * pInstance);
/* ... */
 

API Parameters

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

pInstance
Output. Pointer to a string buffer where the database manager instance name is placed. This buffer must be at least 8 bytes in length.

REXX API Syntax



GET INSTANCE INTO :instance 

REXX API Parameters

instance
A REXX host variable into which the database manager instance name is to be placed.

Sample Programs

C
\sqllib\samples\c\dbinst.c

COBOL
\sqllib\samples\cobol\dbinst.cbl

FORTRAN
\sqllib\samples\fortran\dbinst.f

REXX
\sqllib\samples\rexx\dbinst.cmd

Usage Notes

The value in the DB2INSTANCE environment variable is not necessarily the instance to which the user is attached.

To identify the instance to which a user is currently attached, call sqleatin - Attach, with null arguments except for the sqlca structure.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]