The Database Description Block (SQLEDBDESC) structure can be used during a
call to sqlecrea - Create Database to specify permanent values for database attributes. These attributes
include database comment, collating sequences, and table space definitions.
Table 35. Fields in the SQLEDBDESC Structure
| 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. | ||
| SQLDBUDC | CHAR(256) | 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 not equal to SQL_CS_USER, this field is ignored. | ||
| SQLDBCMT | CHAR(30) | The comment for the database. | ||
| SQLDBSGP | INTEGER | Reserved field. No longer used. | ||
| SQLDBNSG | SHORT | A value which 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.
| ||
| 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 temporary table space. If null, a default temporary table space based on the values of SQLTSEXT and SQLDBNSG will be created. |
The Tablespace Description Block structure (SQLETSDESC) is used to specify
the attributes of any of the three initial table spaces.
Table 36. Fields in the SQLETSDESC Structure
| 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 extentsize, in 4KB 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 prefetchsize, in 4KB pages. If a value of -1 is supplied, this field will default to the current value of the dft_prefetch_sz configuration parameter. |
| SQLPOVHD | DOUBLE | Table space I/O overhead, 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. |
Table 37. Fields in the SQLETSCDESC Structure
| 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. |
Valid values for SQLDBCSS (defined in sqlenv) are:
Valid values for SQLTSTYPE (defined in sqlenv) are:
Valid values for SQLCTYPE (defined in sqlenv) are:
Language Syntax
C Structure
/* File: sqlenv.h */
/* Structure: SQLEDBDESC */
/* ... */
SQL_STRUCTURE sqledbdesc
{
_SQLOLDCHAR sqldbdid[8];
long sqldbccp;
long sqldbcss;
unsigned char sqldbudc[SQL_CS_SZ];
_SQLOLDCHAR sqldbcmt[SQL_CMT_SZ+1];
_SQLOLDCHAR pad[1];
unsigned long sqldbsgp;
short sqldbnsg;
char pad2[2];
long sqltsext;
struct SQLETSDESC *sqlcatts;
struct SQLETSDESC *sqlusrts;
struct SQLETSDESC *sqltmpts;
};
/* ... */
|
/* File: sqlenv.h */
/* Structure: SQLETSDESC */
/* ... */
SQL_STRUCTURE SQLETSDESC
{
char sqltsdid[8];
long sqlextnt;
long sqlprftc;
double sqlpovhd;
double sqltrfrt;
char sqltstyp;
char pad1;
short sqlccnt;
struct SQLETSCDESC containr[1];
};
/* ... */
|
/* File: sqlenv.h */
/* Structure: SQLETSCDESC */
/* ... */
SQL_STRUCTURE SQLETSCDESC
{
char sqlctype;
char pad1[3];
long sqlcsize;
short sqlclen;
char sqlcontr[SQLB_MAX_CONTAIN_NAME_SZ];
char pad2[2];
};
/* ... */
|
COBOL Structure
* 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).
*
|