Administrative API Reference

sqlegdad - Catalog DCS Database

Stores information about remote databases in the Database Connection Services (DCS) directory. These databases are accessed through an Application Requester (AR), such as DB2 Connect. Having a DCS directory entry with a database name matching a database name in the system database directory invokes the specified AR to forward SQL requests to the remote server where the database resides. For more information about DB2 Connect and DCS directory entries, see the DB2 Connect User's Guide.

Authorization

One of the following:

Required Connection

None

Version

sqlenv.h

C API Syntax



/* File: sqlenv.h */
/* API: Catalog DCS Database */
/* ... */
SQL_API_RC SQL_API_FN
  sqlegdad (
    struct sql_dir_entry * pDCSDirEntry,
    struct sqlca * pSqlca);
/* ... */
 

Generic API Syntax



/* File: sqlenv.h */
/* API: Catalog DCS Database */
/* ... */
SQL_API_RC SQL_API_FN
  sqlggdad (
    struct sqlca * pSqlca,
    struct sql_dir_entry * pDCSDirEntry);
/* ... */
 

API Parameters

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

pDCSDirEntry
Input. A pointer to an sql_dir_entry (Database Connection Services directory) structure. For more information about this structure, see SQL-DIR-ENTRY.

REXX API Syntax



CATALOG DCS DATABASE dbname [AS target_dbname]
[AR arname] [PARMS parms] [WITH comment]

REXX API Parameters

dbname
The local database name of the directory entry to be added.

target_dbname
The target database name.

arname
The application client name.

parms
Parameter string. If specified, the string must be enclosed by double quotation marks.

comment
Description associated with the entry. Maximum length is 30 characters. Enclose the comment by double quotation marks.

Sample Programs

C
\sqllib\samples\c\dcscat.c

COBOL
\sqllib\samples\cobol\dcscat.cbl

REXX
\sqllib\samples\rexx\dcscat.cmd

Usage Notes

The DB2 Connect program provides connections to DRDA Application Servers such as:

The database manager creates a Database Connection Services directory if one does not exist. This directory is stored on the path that contains the database manager instance that is being used. The DCS directory is maintained outside of the database.

The database must also be cataloged as a remote database in the system database directory.

List the contents of the DCS directory using sqlegdsc - Open DCS Directory Scan, sqlegdge - Get DCS Directory Entry for Database, sqlegdgt - Get DCS Directory Entries, and sqlegdcl - Close DCS Directory Scan.
Note:If directory caching is enabled (see the configuration parameter dir_cache in sqlfxsys - Get Database Manager Configuration), database, node, and DCS directory files are cached in memory. An application's directory cache is created during its first directory lookup. Since the cache is only refreshed when the application modifies any of the directory files, directory changes made by other applications may not be effective until the application has restarted. To refresh DB2's shared cache (server only), stop (db2stop) and then restart (db2start) the database manager. To refresh the directory cache for another application, stop and then restart that application.

See Also

sqlegdel - Uncatalog DCS Database.


[ Top of Page | Previous Page | Next Page ]