The Database Description Block (SQLEDBDESC) structure can be used during a call to the sqlecrea API to specify permanent values for database attributes. These attributes include database comment, collating sequences, and table space definitions.
Field Name | Data Type | Description |
---|---|---|
SQLDBDID | CHAR(8) | A structure identifier and "eye-catcher" for storage dumps. It is a string of eight bytes that must be initialized with the value of SQLE_DBDESC_2 (defined in sqlenv). The contents of this field are validated for version control. |
SQLDBCCP | INTEGER | The code page of the database comment. This value is no longer used by the database manager. |
SQLDBCSS | INTEGER | A value indicating the source of the database collating sequence. Note: Specify SQL_CS_NONE to specify that the collating sequence for the database is IDENTITY (which implements a binary collating sequence). SQL_CS_NONE is the default. |
SQLDBUDC | CHAR(256) | If SQLDBCSS is set to SQL_CS_USER, the nth byte of this field contains the sort weight of the code point whose underlying decimal representation is n in the code page of the database. If SQLDBCSS is set to SQL_CS_UNICODE, this field contains the language-aware or locale-sensitive UCA-based collation name (a NULL terminated string up to 128 bytes in length). If SQLDBCSS is not equal to SQL_CS_USER or SQL_CS_UNICODE, this field is ignored. |
SQLDBCMT | CHAR(30) | The comment for the database. |
SQLDBSGP | INTEGER | Reserved field. No longer used. |
SQLDBNSG | SHORT | A value that indicates the number of file segments to be created in the database. The minimum value for this field is 1 and the maximum value for this field is 256. If a value of -1 is supplied, this field will default to 1. Note: SQLDBNSG set to zero produces a default for Version 1 compatibility. |
SQLTSEXT | INTEGER | A value, in 4KB pages, which indicates the default extent size for each table space in the database. The minimum value for this field is 2 and the maximum value for this field is 256. If a value of -1 is supplied, this field will default to 32. |
SQLCATTS | Pointer | A pointer to a table space description control block, SQLETSDESC, which defines the catalog table space. If null, a default catalog table space based on the values of SQLTSEXT and SQLDBNSG will be created. |
SQLUSRTS | Pointer | A pointer to a table space description control block, SQLETSDESC, which defines the user table space. If null, a default user table space based on the values of SQLTSEXT and SQLDBNSG will be created. |
SQLTMPTS | Pointer | A pointer to a table space description control block, SQLETSDESC, which defines the system temporary table space. If null, a default system temporary table space based on the values of SQLTSEXT and SQLDBNSG will be created. |
Field Name | Data Type | Description |
---|---|---|
SQLTSDID | CHAR(8) | A structure identifier and "eye-catcher" for storage dumps. It is a string of eight bytes that must be initialized with the value of SQLE_DBTSDESC_1 (defined in sqlenv). The contents of this field are validated for version control. |
SQLEXTNT | INTEGER | Table space extent size, in 4 KB pages. If a value of -1 is supplied, this field will default to the current value of the dft_extent_sz configuration parameter. |
SQLPRFTC | INTEGER | Table space prefetch size, in 4 KB pages. If a value of -1 is supplied, this field will default to the current value of the dft_prefetch_sz configuration parameter. |
SQLFSCACHING | UNSIGNED CHAR | File system caching. If a value of 1 is supplied, file system caching will be OFF for the current table space. If a value of 0 is supplied, file system caching will be ON for the current table space. Specify 2 to indicate the default setting. In this case, file system caching will be OFF on AIX®, Linux, Solaris, and Windows except on AIX JFS, Linux on System z®, Solaris non-VxFS for SMS temporary table space files, and for SMS Large Object files or Large Files. File system caching will be ON for all other platforms. |
SQLPOVHD | DOUBLE | Table space I/O usage, in milliseconds. If a value of -1 is supplied, this field will default to an internal database manager value (currently 24.1 ms) that could change with future releases. |
SQLTRFRT | DOUBLE | Table space I/O transfer rate, in milliseconds. If a value of -1 is supplied, this field will default to an internal database manager value (currently 0.9 ms) that could change with future releases. |
SQLTSTYP | CHAR(1) | Indicates whether the table space is system-managed or database-managed. . |
SQLCCNT | SMALLINT | Number of containers being assigned to the table space. Indicates how many SQLCTYPE/SQLCSIZE/SQLCLEN/SQLCONTR values follow. |
CONTAINR | Array | An array of sqlccnt SQLETSCDESC structures. |
Field Name | Data Type | Description |
---|---|---|
SQLCTYPE | CHAR(1) | Identifies the type of this container. . |
SQLCSIZE | INTEGER | Size of the container identified in SQLCONTR, specified in 4KB pages. Valid only when SQLTSTYP is set to SQL_TBS_TYP_DMS. |
SQLCLEN | SMALLINT | Length of following SQLCONTR value. |
SQLCONTR | CHAR(256) | Container string. |
Collating sequence is language-based for a Unicode database. The specific collation name is specified in the SQLDBUDC field and must be terminated with a 0x00 byte. The collation name can identify any language-aware collation as defined in "Language-aware collations for Unicode data" or any locale-sensitive UCA-based collation identified in "Unicode Collation Algorithm based collations".
For example, to use collation equivalent to US English in code page 819, set SQLDBCSS to SQL_CS_UNICODE and SQLDBUDC to SYSTEM_819_US.
SQL_STRUCTURE sqledbdesc
{
_SQLOLDCHAR sqldbdid[8];
sqlint32 sqldbccp;
sqlint32 sqldbcss;
unsigned char sqldbudc[SQL_CS_SZ];
_SQLOLDCHAR sqldbcmt[SQL_CMT_SZ+1];
_SQLOLDCHAR pad[1];
sqluint32 sqldbsgp;
short sqldbnsg;
char pad2[2];
sqlint32 sqltsext;
struct SQLETSDESC *sqlcatts;
struct SQLETSDESC *sqlusrts;
struct SQLETSDESC *sqltmpts;
};
SQL_STRUCTURE SQLETSDESC
{
char sqltsdid[8];
sqlint32 sqlextnt;
sqlint32 sqlprftc;
double sqlpovhd;
double sqltrfrt;
char sqltstyp;
unsigned char sqlfscaching;
short sqlccnt;
struct SQLETSCDESC containr[1];
};
SQL_STRUCTURE SQLETSCDESC
{
char sqlctype;
char pad1[3];
sqlint32 sqlcsize;
short sqlclen;
char sqlcontr[SQLB_MAX_CONTAIN_NAME_SZ];
char pad2[2];
};
* File: sqlenv.cbl
01 SQLEDBDESC.
05 SQLDBDID PIC X(8).
05 SQLDBCCP PIC S9(9) COMP-5.
05 SQLDBCSS PIC S9(9) COMP-5.
05 SQLDBUDC PIC X(256).
05 SQLDBCMT PIC X(30).
05 FILLER PIC X.
05 SQL-PAD PIC X(1).
05 SQLDBSGP PIC 9(9) COMP-5.
05 SQLDBNSG PIC S9(4) COMP-5.
05 SQL-PAD2 PIC X(2).
05 SQLTSEXT PIC S9(9) COMP-5.
05 SQLCATTS USAGE IS POINTER.
05 SQLUSRTS USAGE IS POINTER.
05 SQLTMPTS USAGE IS POINTER.
*
* File: sqletsd.cbl
01 SQLETSDESC.
05 SQLTSDID PIC X(8).
05 SQLEXTNT PIC S9(9) COMP-5.
05 SQLPRFTC PIC S9(9) COMP-5.
05 SQLPOVHD USAGE COMP-2.
05 SQLTRFRT USAGE COMP-2.
05 SQLTSTYP PIC X.
05 SQL-PAD1 PIC X.
05 SQLCCNT PIC S9(4) COMP-5.
05 SQL-CONTAINR OCCURS 001 TIMES.
10 SQLCTYPE PIC X.
10 SQL-PAD1 PIC X(3).
10 SQLCSIZE PIC S9(9) COMP-5.
10 SQLCLEN PIC S9(4) COMP-5.
10 SQLCONTR PIC X(256).
10 SQL-PAD2 PIC X(2).
*
* File: sqlenv.cbl
01 SQLETSCDESC.
05 SQLCTYPE PIC X.
05 SQL-PAD1 PIC X(3).
05 SQLCSIZE PIC S9(9) COMP-5.
05 SQLCLEN PIC S9(4) COMP-5.
05 SQLCONTR PIC X(256).
05 SQL-PAD2 PIC X(2).
*