DB2 10.5 for Linux, UNIX, and Windows

sql_dir_entry data structure

This structure is used by the DCS directory APIs.

Table 1. Fields in the SQL-DIR-ENTRY Structure
Field Name Data Type Description
STRUCT_ID RELEASE CODEPAGE COMMENT LDB TDB AR PARM SMALLINT SMALLINT SMALLINT CHAR(30) CHAR(8) CHAR(18) CHAR(32) CHAR(512) Structure identifier. Set to SQL_DCS_STR_ID (defined in sqlenv). Release version (assigned by the API). Code page for comment. Optional description of the database. Local name of the database; must match database alias in system database directory. Actual name of the database. Name of the application client. Contains transaction program prefix, transaction program name, SQLCODE mapping file name, and disconnect and security option.
Note: The character fields passed in this structure must be null terminated or blank filled up to the length of the field.

API and data structure syntax

SQL_STRUCTURE sql_dir_entry
{
        unsigned short         struct_id;
        unsigned short         release;
        unsigned short         codepage;
        _SQLOLDCHAR comment[SQL_CMT_SZ + 1];
        _SQLOLDCHAR ldb[SQL_DBNAME_SZ + 1];
        _SQLOLDCHAR tdb[SQL_LONG_NAME_SZ + 1];
        _SQLOLDCHAR ar[SQL_AR_SZ + 1];
        _SQLOLDCHAR parm[SQL_PARAMETER_SZ + 1];
};

COBOL Structure

* File: sqlenv.cbl
01 SQL-DIR-ENTRY.
    05 STRUCT-ID              PIC 9(4) COMP-5.
    05 RELEASE-LVL            PIC 9(4) COMP-5.
    05 CODEPAGE               PIC 9(4) COMP-5.
    05 COMMENT                PIC X(30).
    05 FILLER                 PIC X.
    05 LDB                    PIC X(8).
    05 FILLER                 PIC X.
    05 TDB                    PIC X(18).
    05 FILLER                 PIC X.
    05 AR                     PIC X(32).
    05 FILLER                 PIC X.
    05 PARM                   PIC X(512).
    05 FILLER                 PIC X.
    05 FILLER                 PIC X(1).
*