db2SelectDB2Copy API - Select the Db2 copy to be used by your application
Sets the environment required by your application to use a particular Db2 copy or the location
specified.
If your environment is already set up for the Db2 copy you want to use,
you do not need to call this API. If, however, you need to use a different Db2 copy you must call
this API. Call this API before loading any Db2
dll files within your process. This call can only be made once per
process.
Authorization
None
Required connection
None
API include file
db2ApiInstall.h
API and data structure syntax
SQL_API_RC SQL_API_FN
db2SelectDB2Copy (
db2Uint32 versionNumber,
void *pDB2SelectDB2CopyStruct);
typedef enum DB2CopyParmType
{
DB2CopyInvalid=0,
DB2CopyName,
DB2CopyPath
} db2CopyParmType;
typedef struct DB2SelectDB2CopyStruct
{
DB2CopyParmType Type;
char *psziDB2Copy;
} db2SelectDB2CopyStruct
db2SelectDB2Copy API parameters
- versionNumber
- Input. Specifies the version number and release level of the variable passed in as the second parameter, pDB2SelectInstallationStruct.
- pDB2SelectDB2CopyStruct
- Input. A pointer to the DB2SelectDB2CopyStruct structure.
DB2SelectDB2CopyStruct data structure parameters
- Type
- Input. This can be either DB2CopyName or DB2CopyPath.
- psziDB2Copy
- Input. If Type is specified as DB2CopyName, psziDB2Copy is the name of the Db2 copy. If Type is specified as db2CopyPath, psziDB2Copy is the Db2 installation path. This cannot be NULL.
Usage notes
To use the API, you will need to include db2ApiInstall.h, which will force your application to statically link in db2ApiInstall.lib.
In addition, this API must be called before loading any Db2 libraries and can
only be called once by an application. You can avoid loading Db2 libraries by making
use of the /delayload
option when linking Db2 libraries or you can
load these libraries dynamically using LoadLibraryEx and specifying
LOAD_WITH_ALTERED_SEA.