Db2 APIs

Lists the Db2 APIs that are demonstrated in the Db2 samples.

Important: Db2 Administrative APIs are not supported in multi-threaded applications, unless you explicitly manage their contexts with the use of Db2 context APIs. Instead, Administrative APIs, along with context APIs, use the SYSPROC.ADMIN_CMD stored procedure and rely on the Db2 database manager to automatically manage the contexts for you with its multi-threaded application support. For details about multi-threaded application support and using contexts for threaded applications with concurrent access, see: Mixed multithreaded CLI applications.
The first table lists the Db2 APIs grouped by functional category, their corresponding include files, and the sample programs that demonstrate them (see the note after the table for more information about the include files). The second table lists the C/C++ sample programs and shows the Db2 APIs demonstrated in each C/C++ program. The third table shows the COBOL sample programs and the Db2 APIs demonstrated in each COBOL program.
Db2 APIs, Include files, and Sample Programs
Table 1.
C/C++ Sample Programs with Db2 APIs
Table 2.
COBOL Sample Programs with Db2 APIs
Table 3.
Table 1. Db2 APIs, Include files, and Sample Programs
API Type Db2 API Include File Sample Programs
Database control APIs db2DatabaseQuiesce API - Quiesce the database db2ApiDf n/a
Database control APIs db2DatabaseUnquiesce API - Unquiesce database db2ApiDf n/a
Database control APIs db2DatabaseRestart API - Restart database db2ApiDf C: dbconn.sqc C++: dbconn.sqC
Database control APIs sqlecrea API - Create database sqlenv C: dbcreate.c dbrecov.sqc dbsample.sqc C++: dbcreate.C dbrecov.sqC COBOL: db_udcs.cbl dbconf.cbl ebcdicdb.cbl
Database control APIs sqlecran API - Create a database on a database partition server sqlenv n/a
Database control APIs sqledrpd API - Drop database sqlenv C: dbcreate.c C++: dbcreate.C COBOL: dbconf.cbl
Database control APIs sqledpan API - Drop a database on a database partition server sqlenv n/a
Database control APIs db2DatabaseUpgrade API - Upgrade previous version of Db2 database to the current release db2ApiDf C: dbupgrade.c C++: dbupgrade.C COBOL: dbupgrade.cbl
Database control APIs db2XaListIndTrans API - List indoubt transactions db2ApiDf n/a
Database control APIs sqle_activate_db API - Activate database sqlenv n/a
Database control APIs sqle_deactivate_db API - Deactivate database sqlenv n/a
Database control APIs sqlcspqy API - List DRDA indoubt transactions sqlxa n/a
Database control APIs db2SetWriteForDB API - Suspend or resume I/O writes for database db2ApiDf n/a
Database control APIs sqlefrce API - Force users and applications off the system sqlenv C: dbconn.sqc dbsample.sqc instart.c C++: dbconn.sqC instart.C COBOL: dbstop.cbl
Instance control APIs db2InstanceStart API - Start instance db2ApiDf C: instart.c C++: instart.C
Instance control APIs db2InstanceStop API - Stop instance db2ApiDf C: instart.c C++: instart.C
Instance control APIs db2InstanceQuiesce API - Quiesce instance db2ApiDf n/a
Instance control APIs db2InstanceUnquiesce API - Unquiesce instance db2ApiDf n/a
Instance control APIs sqleatin API - Attach to instance sqlenv C: inattach.c utilapi.c C++: inattach.C utilapi.C COBOL: dbinst.cbl
Instance control APIs sqleatcp API - Attach to instance and change password sqlenv C: inattach.c C++: inattach.C COBOL: dbinst.cbl
Instance control APIs sqledtin API - Detach from instance sqlenv C: inattach.c utilapi.c C++: inattach.C utilapi.C COBOL: dbinst.cbl
Instance control APIs sqlegins API - Get current instance sqlenv C: ininfo.c C++: ininfo.C COBOL: dbinst.cbl
Instance control APIs db2UtilityControl API - Set the priority level of running utilities db2ApiDf n/a
Database manager and database configuration APIs db2CfgGet API - Get the database manager or database configuration parameters db2ApiDf C: dbinfo.c dbrecov.sqc ininfo.c tscreate.sqc C++: dbinfo.C dbrecov.sqC ininfo.C tscreate.sqC
Database manager and database configuration APIs db2CfgSet API - Set the database manager or database configuration parameters db2ApiDf C: dbinfo.c dbrecov.sqc ininfo.c C++: dbinfo.C dbrecov.sqC ininfo.C
Database manager and database configuration APIs db2AutoConfig API - Access the Configuration Advisor db2AuCfg C: dbcfg.sqc C++: dbcfg.sqC
Database manager and database configuration APIs db2AutoConfigFreeMemory API - Free the memory allocated by the db2AutoConfig API db2AuCfg C: dbcfg.sqc C++: dbcfg.sqC
Database monitoring APIs db2GetSnapshotSize API - Estimate the output buffer size required for the db2GetSnapshot API db2ApiDf n/a
Database monitoring APIs db2AddSnapshotRequest API - Add a snapshot request db2ApiDf n/a
Database monitoring APIs db2MonitorSwitches API - Get or update the monitor switch settings db2ApiDf C: utilsnap.c C++: utilsnap.C
Database monitoring APIs db2GetSnapshot API - Get a snapshot of the database manager operational status db2ApiDf C: utilsnap.c C++: utilsnap.C
Database monitoring APIs db2ResetMonitor API - Reset the database system monitor data db2ApiDf n/a
Database monitoring APIs db2ConvMonStream API - Convert the monitor stream to the pre-version 6 format db2ApiDf n/a
Database monitoring APIs db2Inspect API - Inspect database for architectural integrity db2ApiDf n/a
Database health monitoring APIs db2AddContact API - Add a contact to whom notification messages can be sent db2ApiDf n/a
Database health monitoring APIs db2AddContactGroup API - Add a contact group to whom notification messages can be sent db2ApiDf n/a
Database health monitoring APIs db2DropContact API - Remove a contact from the list of contacts to whom notification messages can be sent db2ApiDf n/a
Database health monitoring APIs db2DropContactGroup API - Remove a contact group from the list of contacts to whom notification messages can be sent db2ApiDf n/a
Database health monitoring APIs db2GetAlertCfg API - Get the alert configuration settings for the health indicators db2ApiDf n/a
Database health monitoring APIs db2GetAlertCfgFree API - Free the memory allocated by the db2GetAlertCfg API db2ApiDf n/a
Database health monitoring APIs db2GetContactGroup API - Get the list of contacts in a single contact group to whom notification messages can be sent db2ApiDf n/a
Database health monitoring APIs db2GetContactGroups API - Get the list of contact groups to whom notification messages can be sent db2ApiDf n/a
Database health monitoring APIs db2GetContacts API - Get the list of contacts to whom notification messages can be sent db2ApiDf n/a
Database health monitoring APIs db2GetHealthNotificationList API - Get the list of contacts to whom health alert notifications can be sent db2ApiDf n/a
Database health monitoring APIs db2ResetAlertCfg API - Reset the alert configuration of health indicators db2ApiDf n/a
Database health monitoring APIs db2UpdateAlertCfg API - Update the alert configuration settings for health indicators db2ApiDf n/a
Database health monitoring APIs db2UpdateContact API - Update the attributes of a contact db2ApiDf n/a
Database health monitoring APIs db2UpdateContactGroup API - Update the attributes of a contact group db2ApiDf n/a
Database health monitoring APIs db2UpdateHealthNotificationList API - Update the list of contacts to whom health alert notifications can be sent db2ApiDf n/a
Database health monitoring APIs db2GetSnapshot API - Get a snapshot of the database manager operational status db2ApiDf C: utilsnap.c C++: utilsnap.C
Database health monitoring APIs db2GetSnapshotSize API - Estimate the output buffer size required for the db2GetSnapshot API db2ApiDf n/a
Database health monitoring APIs db2GetRecommendations API - Get recommendations to resolve a health indicator in alert state db2ApiDf n/a
Database health monitoring APIs db2GetRecommendationsFree API - Free the memory allocated by the db2GetRecommendations API db2ApiDf n/a
Data movement APIs db2Export API - Export data from a database sqlutil C: tbmove.sqc C++: tbmove.sqC COBOL: expsamp.sqb impexp.sqb tload.sqb
Data movement APIs db2Import API - Import data into a table, hierarchy, nickname or view db2ApiDf C: dtformat.sqc tbmove.sqc C++: tbmove.sqC COBOL: expsamp.sqb impexp.sqb
Data movement APIs db2Load API - Load data into a table db2ApiDf C: dtformat.sqc tbload.sqc tbmove.sqc C++: tbmove.sqC
Data movement APIs db2LoadQuery API - Get the status of a load operation db2ApiDf C: tbmove.sqc C++: tbmove.sqC COBOL: loadqry.sqb
Data movement APIs db2Ingest API- Ingest data from an input file or pipe into a Db2 table db2ApiDf n/a
Recovery APIs db2Backup API - Back up a database or table space db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2Restore API - Restore a database or table space db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2Recover API - Restore and roll forward a database db2ApiDf n/a
Recovery APIs db2Rollforward API - Roll forward a database db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2HistoryOpenScan API - Start a database history records scan db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2HistoryGetEntry API - Get the next entry in the database history records db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2HistoryCloseScan API - End the database history records scan db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2Prune API - Delete the history file entries or log files from the active log path db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2HistoryUpdate API - Update a database history records entry db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Recovery APIs db2ArchiveLog API - Archive the active log file db2ApiDf n/a
High Availability Disaster Recovery (HADR) APIs db2HADRStart API - Start high availability disaster recovery (HADR) operations db2ApiDf n/a
High Availability Disaster Recovery (HADR) APIs db2HADRStop API - Stop high availability disaster recovery (HADR) operations db2ApiDf n/a
High Availability Disaster Recovery (HADR) APIs db2HADRTakeover API - Instruct a database to take over as the high availability disaster recovery (HADR) primary database db2ApiDf n/a
Database directory and DCS directory management APIs sqlecadb API - Catalog a database in the system database directory sqlenv C: ininfo.c C++: ininfo.C COBOL: dbcat.cbl
Database directory and DCS directory management APIs sqleuncd API - Uncatalog a database from the system database directory sqlenv C: ininfo.c C++: ininfo.C COBOL: dbcat.cbl
Database directory and DCS directory management APIs sqlegdad API - Catalog a database in the database connection services (DCS) directory sqlenv C: ininfo.c C++: ininfo.C COBOL: dcscat.cbl
Database directory and DCS directory management APIs sqlegdel API - Uncatalog a database from the database connection services (DCS) directory sqlenv C: ininfo.c C++: ininfo.C COBOL: dcscat.cbl
Database directory and DCS directory management APIs sqledcgd API - Change a database comment in the system or local database directory sqlenv C: ininfo.c C++: ininfo.C COBOL: dbcmt.cbl
Database directory and DCS directory management APIs db2DbDirOpenScan API - Start a system or local database directory scan db2ApiDf C: ininfo.c C++: ininfo.C COBOL: dbcat.cbl dbcmt.cbl
Database directory and DCS directory management APIs db2DbDirGetNextEntry API - Get the next system or local database directory entry db2ApiDf C: ininfo.c C++: ininfo.C COBOL: dbcat.cbl dbcmt.cbl
Database directory and DCS directory management APIs db2DbDirCloseScan API - End a system or local database directory scan db2ApiDf C: ininfo.c C++: ininfo.C COBOL: dbcat.cbl dbcmt.cbl
Database directory and DCS directory management APIs sqlegdsc API - Start a database connection services (DCS) directory scan sqlenv C: ininfo.c C++: ininfo.C COBOL: dcscat.cbl
Database directory and DCS directory management APIs sqlegdgt API - Get database connection services (DCS) directory entries sqlenv C: ininfo.c C++: ininfo.C COBOL: dcscat.cbl
Database directory and DCS directory management APIs sqlegdcl API - End a database connection services (DCS) directory scan sqlenv C: ininfo.c C++: ininfo.C COBOL: dcscat.cbl
Database directory and DCS directory management APIs sqlegdge API - Get a specific entry in the database connection services (DCS) directory sqlenv C: ininfo.c C++: ininfo.C COBOL: dcscat.cbl
Database directory and DCS directory management APIs db2UpdateAlternateServerForDB API - Update the alternate server for a database alias in the system database directory db2ApiDf n/a
Client/server management APIs sqleqryc API - Query client connection settings sqlenv C: cli_info.c C++: cli_info.C COBOL: client.cbl
Client/server management APIs sqleqryi API - Query client information sqlenv C: cli_info.c C++: cli_info.C
Client/server management APIs sqlesetc API - Set client connection settings sqlenv C: cli_info.c dbcfg.sqc dbmcon.sqc C++: cli_info.C dbcfg.sqC dbmcon.sqC COBOL: client.cbl
Client/server management APIs sqleseti API - Set client information sqlenv C: cli_info.c C++: cli_info.C
Client/server management APIs sqlesact API - Set accounting string sqlenv COBOL: setact.cbl
Client/server management APIs db2DatabasePing API - Ping the database to test network response time db2ApiDf n/a
Client/server management APIs sqleisig API - Install signal handler sqlenv COBOL: dbcmt.cbl
Client/server management APIs sqleintr API - Interrupt application requests sqlenv n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapRegister API - Register the Db2 server on the LDAP server db2ApiDf n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapUpdate API - Update the attributes of the Db2 server on the LDAP server db2ApiDf n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapDeregister API - Deregister the Db2 server and cataloged databases from the LDAP server db2ApiDf n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapCatalogNode API - Provide an alias for node name in LDAP server db2ApiDf n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapUncatalogNode API - Delete alias for node name from LDAP server db2ApiDf n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapCatalogDatabase API - Register the database on the LDAP server db2ApiDf n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapUncatalogDatabase API - Deregister database from LDAP server db2ApiDf n/a
Lightweight Directory Access Protocol (LDAP) directory management APIs db2LdapUpdateAlternateServerForDB API - Update the alternate server for the database on the LDAP server db2ApiDf n/a
Application programming and preparation APIs sqlaintp API - Get error message sql C: dbcfg.sqcutilapi.c C++: dbcfg.sqC utilapi.C COBOL: checkerr.cbl
Application programming and preparation APIs sqlogstt API - Get the SQLSTATE message sql C: utilapi.c C++: utilapi.C COBOL: checkerr.cbl
Application programming and preparation APIs sqleisig API - Install signal handler sqlenv COBOL: dbcmt.cbl
Application programming and preparation APIs sqleintr API - Interrupt application requests sqlenv n/a
Application programming and preparation APIs sqlaprep API - Precompile application program sql C: dbpkg.sqc C++: dbpkg.sqC
Application programming and preparation APIs sqlabndx API - Bind application program to create a package sql C: dbpkg.sqc dbsample.sqc C++: dbpkg.sqC
Application programming and preparation APIs sqlarbnd API - Rebind package sql C: dbpkg.sqc C++: dbpkg.sqC COBOL: rebind.sqb
COBOL, FORTRAN and REXX application specific APIs sqlgaddr API - Get the address of a variable sqlutil n/a
COBOL, FORTRAN and REXX application specific APIs sqlgdref API - Dereference an address sqlutil n/a
COBOL, FORTRAN and REXX application specific APIs sqlgmcpy API - Copy data from one memory area to another sqlutil n/a
Table space and table management APIs sqlbtcq API - Get the query data for all table space containers This command or API has been deprecated and might be removed in a future release. See tsinfo.db2 tsinfo.db2 for a sample program that uses a replacement function. sqlutil n/a
Table space and table management APIs sqlbotcq API - Open a table space container query sqlutil COBOL: tabscont.sqb tspace.sqb
Table space and table management APIs sqlbftcq API - Fetch the query data for rows in a table space container sqlutil COBOL: tabscont.sqb tspace.sqb
Table space and table management APIs sqlbctcq API - Close a table space container query sqlutil COBOL: tabscont.sqb tspace.sqb
Table space and table management APIs sqlbstsc API - Set table space containers sqlutil C: dbrecov.sqc C++: dbrecov.sqC COBOL: tabscont.sqb tspace.sqb
Table space and table management APIs sqlbmtsq API - Get the query data for all table spaces This command or API has been deprecated and might be removed in a future release. See tsinfo.db2 for a sample program that uses a replacement function. sqlutil n/a
Table space and table management APIs sqlbstpq API - Get information about a single table space sqlutil COBOL: tabspace.sqb tspace.sqb
Table space and table management APIs sqlbotsq API - Open a table space query This command or API has been deprecated and might be removed in a future release. sqlutil n/a
Table space and table management APIs sqlbftpq API - Fetch the query data for rows in a table space sqlutil COBOL: tabspace.sqb tspace.sqb
Table space and table management APIs sqlbctsq API - Close a table space query This command or API has been deprecated and might be removed in a future release. sqlutil n/a
Table space and table management APIs This command or API has been deprecated and might be removed in a future release. sqlutil n/a
Table space and table management APIs sqluvqdp API - Quiesce table spaces for a table sqlutil C: tbmove.sqc C++: tbmove.sqC COBOL: tload.sqb
Table space and table management APIs db2Runstats API - Update statistics for tables and indexes db2ApiDf C: tbreorg.sqc C++: tbreorg.sqC COBOL: dbstat.sqb
Table space and table management APIs db2Reorg API - Reorganize an index or a table db2ApiDf C: tbreorg.sqc C++: tbreorg.sqC COBOL: dbstat.sqb
Table space and table management APIs sqlefmem API - Free the memory allocated by the sqlbtcq and sqlbmtsq API sqlenv C: dbrecov.sqc C++: dbrecov.sqC COBOL: tabscont.sqb tabspace.sqb tspace.sqb
Node directory management APIs sqlectnd API - Catalog an entry in the node directory sqlenv C: ininfo.c C++: ininfo.C COBOL: nodecat.cbl
Node directory management APIs sqleuncn API - Uncatalog an entry from the node directory sqlenv C: ininfo.c C++: ininfo.C COBOL: nodecat.cbl
Node directory management APIs sqlenops API - Start a node directory scan sqlenv C: ininfo.c C++: ininfo.C COBOL: nodecat.cbl
Node directory management APIs sqlengne API - Get the next node directory entry sqlenv C: ininfo.c C++: ininfo.C COBOL: nodecat.cbl
Node directory management APIs sqlencls API - End a node directory scan sqlenv C: ininfo.c C++: ininfo.C COBOL: nodecat.cbl
Node directory management APIs db2UpdateAlternateServerForDB API - Update the alternate server for a database alias in the system database directory db2ApiDf n/a
Satellite synchronization APIs db2GetSyncSession API - Get a satellite synchronization session identifier db2ApiDf n/a
Satellite synchronization APIs db2QuerySatelliteProgress API - Get the status of a satellite synchronization session db2ApiDf n/a
Satellite synchronization APIs db2SetSyncSession API - Set satellite synchronization session db2ApiDf n/a
Satellite synchronization APIs db2SyncSatellite API - Start satellite synchronization db2ApiDf n/a
Satellite synchronization APIs db2SyncSatelliteStop API - Pause satellite synchronization db2ApiDf n/a
Satellite synchronization APIs db2SyncSatelliteTest API - Test whether a satellite can be synchronized db2ApiDf n/a
Read log files APIs db2ReadLog API - Read log records db2ApiDf C: dbrecov.sqc C++: dbrecov.sqC
Read log files APIs db2ReadLogNoConn API - Read the database logs without a database connection db2ApiDf n/a
Read log files APIs db2ReadLogNoConnInit API - Initialize reading the database logs without a database connection db2ApiDf n/a
Read log files APIs db2ReadLogNoConnTerm API - Terminate reading the database logs without a database connection db2ApiDf n/a
Indoubt transaction management APIs db2XaListIndTrans API - List indoubt transactions db2ApiDf n/a
Indoubt transaction management APIs sqlxhfrg API - Forget transaction status sqlxa n/a
Indoubt transaction management APIs sqlxphcm API - Commit an indoubt transaction sqlxa n/a
Indoubt transaction management APIs sqlxphrl API - Roll back an indoubt transaction sqlxa n/a
Indoubt transaction management APIs sqlcspqy API - List DRDA indoubt transactions sqlxa n/a
APIs for obtaining concurrent access to a database sqleAttachToCtx API - Attach to context sql C: dbthrds.sqc C++: dbthrds.sqC
APIs for obtaining concurrent access to a database sqleBeginCtx API - Create and attach to an application context sql C: dbthrds.sqc C++: dbthrds.sqC
APIs for obtaining concurrent access to a database sqleDetachFromCtx API - Detach from context sql C: dbthrds.sqc C++: dbthrds.sqC
APIs for obtaining concurrent access to a database sqleEndCtx API - Detach from and free the memory associated with an application context sql n/a
APIs for obtaining concurrent access to a database sqleGetCurrentCtx API - Get current context sql n/a
APIs for obtaining concurrent access to a database sqleInterruptCtx API - Interrupt context sql n/a
APIs for obtaining concurrent access to a database sqleSetTypeCtx API - Set application context type sql C: dbthrds.sqc C++: dbthrds.sqC
Database partition management APIs sqleaddn API - Add a database partition to the partitioned database environment sqlenv n/a
Database partition management APIs sqledrpn API - Check whether a database partition server can be dropped sqlenv n/a
Database partition management APIs sqlecran API - Create a database on a database partition server sqlenv n/a
Database partition management APIs sqledpan API - Drop a database on a database partition server sqlenv n/a
Database partition management APIs sqlesdeg API - Set the maximum runtime intrapartition parallelism level or degree for SQL statements sqlenv C: ininfo.c C++: ininfo.C
Database partition management APIs sqlugtpi API - Get table distribution information sqlutil n/a
Database partition management APIs sqlugrpn API - Get the database partition server number for a row sqlutil n/a
Miscellaneous APIs db2AdminMsgWrite API - Write log messages for administration and replication function db2ApiDf n/a
Miscellaneous APIs db2XaGetInfo API - Get information for a resource manager sqlxa n/a
Note: Include file extensions vary with programming language. C/C++ include files have a file extension of .h. COBOL include files have a file extension of .cbl. The include files can be found in the following directories:
C/C++ (UNIX):
sqllib/include
C/C++ (Windows):
sqllib\include
COBOL (UNIX):
sqllib/include/cobol_a

sqllib/include/cobol_i

sqllib/include/cobol_mf

COBOL (Windows):
sqllib\include\cobol_a

sqllib\include\cobol_i

sqllib\include\cobol_mf

Table 2. C/C++ Sample Programs with Db2 APIs
Sample Program Included APIs
cli_info.c, cli_info.C
  • sqlesetc API - Set client connection settings
  • sqleseti API - Set client information
  • sqleqryc API - Query client connection settings
  • sqleqryi API - Query client information
dbcfg.sqc, dbcfg.sqC
  • db2AutoConfig API - Access the Configuration Advisor
  • db2AutoConfigFreeMemory API - Free the memory allocated by the db2AutoConfig API
  • sqlesetc API - Set client connection settings
  • sqlaintp API - Get error message
dbconn.sqc, dbconn.sqC
  • db2DatabaseRestart API - Restart database
  • sqlefrce API - Force users and applications off the system
dbcreate.c, dbcreate.C
  • sqlecrea API - Create database
  • sqledrpd API - Drop database
dbinfo.c, dbinfo.C
  • db2CfgGet API - Get the database manager or database configuration parameters
  • db2CfgSet API - Set the database manager or database configuration parameters
dbmcon.sqc, dbmcon.sqC
  • sqlesetc API - Set client connection settings
dbmigrat.c, dbmigrat.C
  • sqlemgdb API - Migrate previous version of Db2 database to current version
dbpkg.sqc, dbpkg.sqC
  • sqlaprep API - Precompile application program
  • sqlabndx API - Bind application program to create a package
  • sqlarbnd API - Rebind package
dbrecov.sqc, dbrecov.sqC
  • db2HistoryCloseScan API - End the history file scan
  • db2HistoryGetEntry API - Get the next entry in the history file
  • db2HistoryOpenScan API - Start a history file scan
  • db2HistoryUpdate API - Update the history file entry
  • db2Prune API - Delete the history file entries or log files from the active log path
  • db2CfgGet API - Get the database manager or database configuration parameters
  • db2CfgSet API - Set the database manager or database configuration parameters
  • sqlbmtsq API - Get the query data for all table spaces
  • sqlbstsc API - Set table space containers
  • sqlbtcq API - Get the query data for all table space containers
  • sqlecrea API - Create database
  • sqledrpd API - Drop database
  • sqlefmem API - Free the memory allocated by the sqlbtcq and sqlbmtsq APIs
  • db2Backup API - Back up a database or table space
  • db2Restore API - Restore a database or table space
  • db2ReadLog API - Asynchronous read log
  • db2ReadLogNoConn API - Read log without a database connection
  • db2Rollforward API - Roll forward a database
dbsample.sqc
  • db2DatabaseRestart API - Restart database
  • sqlecrea API - Create database
  • sqlefrce API - Force users and applications off the system
  • sqlabndx API - Bind application program to create a package
dbthrds.sqc, dbthrds.sqC
  • sqleAttachToCtx API - Attach to context
  • sqleBeginCtx API - Create and attach to an application context
  • sqleDetachFromCtx API - Detach from context
  • sqleSetTypeCtx API - Set application context type
dtformat.sqc
  • db2Load API - Load data into a table
  • db2Import API - Import data into a table, hierarchy, nickname or view
inattach.c, inattach.C
  • sqleatcp API - Attach to instance and change password
  • sqleatin API - Attach to instance
  • sqledtin API - Detach from instance
ininfo.c, ininfo.C
  • db2CfgGet API - Get the database manager or database configuration parameters
  • db2CfgSet API - Set the database manager or database configuration parameters
  • sqlegins API - Get current instance
  • sqlectnd API - Catalog an entry in the node directory
  • sqlenops API - Start a node directory scan
  • sqlengne API - Get the next node directory entry
  • sqlencls API - End a node directory scan
  • sqleuncn API - Uncatalog an entry from the node directory
  • sqlecadb API - Catalog a database in the system database directory
  • db2DbDirOpenScan API - Start a system or local database directory scan
  • db2DbDirGetNextEntry API - Get the next system or local database directory entry
  • sqledcgd API - Change a database comment in the system or local database directory
  • db2DbDirCloseScan API - End a system or local database directory scan
  • sqleuncd API - Uncatalog a database from the system database directory
  • sqlegdad API - Catalog a database in the database connection services (DCS) directory
  • sqlegdsc API - Start a database connection services (DCS) directory scan
  • sqlegdge API - Get a specific entry in the database connection services (DCS) directory
  • sqlegdgt API - Get database connection services (DCS) directory entries
  • sqlegdcl API - End a database connection services (DCS) directory scan
  • sqlegdel API - Uncatalog a database from the database connection services (DCS) directory
  • sqlesdeg API - Set the maximum runtime intrapartition parallelism level or degree for SQL statements
instart.c, instart.C
  • sqlefrce API - Force users and applications off the system
  • db2InstanceStart API - Start instance
  • db2InstanceStop API - Stop instance
tbmove.sqc, tbmove.sqC
  • db2Export API - Export data from a database
  • db2Import API - Import data into a table, hierarchy, nickname or view
  • sqluvqdp API - Quiesce table spaces for a table
  • db2Load API - Load data into a table
  • db2LoadQuery API - Get the status of a load operation
tbreorg.sqc, tbreorg.sqC
  • db2Reorg API - Reorganize an index or a table
  • db2Runstats API - Update statistics about the characteristics of a table and associated indexes
tscreate.sqc, tscreate.sqC
  • db2CfgGet API - Get the database manager or database configuration parameters
utilapi.c, utilapi.C
  • sqlaintp API - Get error message
  • sqlogstt API - Get the SQLSTATE message
  • sqleatin API - Attach to instance
  • sqledtin API - Detach from instance
utilsnap.c, utilsnap.C
  • db2GetSnapshot API - Get a snapshot of the database manager operational status
  • db2MonitorSwitches API - Get or update the monitor switch settings
Table 3. COBOL Sample Programs with Db2 APIs
Sample Program Included APIs
checkerr.cbl
  • sqlaintp API - Get error message
  • sqlogstt API - Get the SQLSTATE message
client.cbl
  • sqleqryc API - Query client connection settings
  • sqlesetc API - Set client connection settings
db_udcs.cbl
  • sqleatin API - Attach to instance
  • sqlecrea API - Create database
  • sqledrpd API - Drop database
dbcat.cbl
  • sqlecadb API - Catalog a database in the system database directory
  • db2DbDirCloseScan API - End a system or local database directory scan
  • db2DbDirGetNextEntry API - Get the next system or local database directory entry
  • db2DbDirOpenScan API - Start a system or local database directory scan
  • sqleuncd API - Uncatalog a database from the system database directory
dbcmt.cbl
  • sqledcgd API - Change a database comment in the system or local database directory
  • db2DbDirCloseScan API - End a system or local database directory scan
  • db2DbDirGetNextEntry API - Get the next system or local database directory entry
  • db2DbDirOpenScan API - Start a system or local database directory scan
  • sqleisig API - Install signal handler
dbinst.cbl
  • sqleatcp API - Attach to instance and change password
  • sqleatin API - Attach to instance
  • sqledtin API - Detach from instance
  • sqlegins API - Get current instance
dbstat.sqb
  • db2Reorg API - Reorganize an index or a table
  • db2Runstats API - Update statistics about the characteristics of a table and associated indexes
dcscat.cbl
  • sqlegdad API - Catalog a database in the database connection services (DCS) directory
  • sqlegdcl API - End a database connection services (DCS) directory scan
  • sqlegdel API - Uncatalog a database from the database connection services (DCS) directory
  • sqlegdge API - Get a specific entry in the database connection services (DCS) directory
  • sqlegdgt API - Get database connection services (DCS) directory entries
  • sqlegdsc API - Start a database connection services (DCS) directory scan
ebcdicdb.cbl
  • sqleatin API - Attach to instance
  • sqlecrea API - Create database
  • sqledrpd API - Drop database
expsamp.sqb
  • db2Export API - Export data from a database
  • db2Import API - Import data into a table, hierarchy, nickname or view
impexp.sqb
  • db2Export API - Export data from a database
  • db2Import API - Import data into a table, hierarchy, nickname or view
loadqry.sqb
  • db2LoadQuery API - Get the status of a load operation
migrate.cbl
  • sqlemgdb API - Migrate previous version of Db2 database to current version
nodecat.cbl
  • sqlectnd API - Catalog an entry in the node directory
  • sqlencls API - End a node directory scan
  • sqlengne API - Get the next node directory entry
  • sqlenops API - Start a node directory scan
  • sqleuncn API - Uncatalog an entry from the node directory
rebind.sqb
  • sqlarbnd API - Rebind package
tabscont.sqb
  • sqlbctcq API - Close a table space container query
  • sqlbftcq API - Fetch the query data for rows in a table space container
  • sqlbotcq API - Open a table space container query
  • sqlbtcq API - Get the query data for all table space containers
  • sqlefmem API - Free the memory allocated by the sqlbtcq and sqlbmtsq APIs
tabspace.sqb
  • sqlbctsq API - Close a table space query
  • sqlbftpq API - Fetch the query data for rows in a table space
  • sqlbgtss API - Get table space usage statistics
  • sqlbmtsq API - Get the query data for all table spaces
  • sqlbotsq API - Open a table space query
  • sqlbstpq API - Get information about a single table space
  • sqlefmem API - Free the memory allocated by the sqlbtcq and sqlbmtsq APIs
tload.sqb
  • db2Export API - Export data from a database
  • sqluvqdp API - Quiesce table spaces for a table
tspace.sqb
  • sqlbctcq API - Close a table space container query
  • sqlbctsq API - Close a table space query
  • sqlbftcq API - Fetch the query data for rows in a table space container
  • sqlbftpq API - Fetch the query data for rows in a table space
  • sqlbgtss API - Get table space usage statistics
  • sqlbmtsq API - Get the query data for all table spaces
  • sqlbotcq API - Open a table space container query
  • sqlbotsq API - Open a table space query
  • sqlbstpq API - Get information about a single table space
  • sqlbstsc API - Set table space containers
  • sqlbtcq API - Get the query data for all table space containers
  • sqlefmem API - Free the memory allocated by the sqlbtcq and sqlbmtsq APIs
setact.cbl
  • sqlesact API - Set accounting string