sqlegins API - Get current instance
Returns the value of the DB2INSTANCE environment variable.
Authorization
None
Required connection
None
API include file
sqlenv.h
API and data structure syntax
SQL_API_RC SQL_API_FN
sqlegins (
_SQLOLDCHAR * pInstance,
struct sqlca * pSqlca);
SQL_API_RC SQL_API_FN
sqlggins (
struct sqlca * pSqlca,
_SQLOLDCHAR * pInstance);
sqlegins API parameters
- pInstance
- Output. Pointer to a string buffer where the database manager instance name is placed. This buffer must be at least 9 bytes in length, including 1 byte for the null terminating character.
- pSqlca
- Output. A pointer to the sqlca structure.
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.
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.