Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 41
SQLNULLABLE Clause
SQL-Nullable Output for C. The following example shows how DDL translates
definitions and descriptions of SQL-nullable items into C source code:
SQL-Nullable Output for COBOL85. The following example shows how DDL
translates definitions and descriptions of SQL-nullable items into COBOL85
source code:
DDL Type
C Type
DEF B SQLNULLABLE.
02 name PIC X(25)
NOT SQLNULLABLE.
02 nickname PIC X(10)
VALUE SQLNULL
02 salary TYPE BINARY
NOT SQLNULLABLE.
02 hire-date TYPE SQL DATE
NOT SQLNULLABLE.
02 subordinate TYPE SQL VARCHAR 15
OCCURS 10 TIMES.
END.
#pragma fieldalign shared2 __b
typedef struct __b
{
char name[25];
struct
{
short indicator;
char valu[10];
} nickname;
short salary;
char hire_date[10];
struct
{
short indicator;
struct
{
short len;
char val[15];
} valu;
} subordinate[10];
} b_def;
DDL Type
COBOL Type
DEF B SQLNULLABLE.
02 name PIC X(25)
NOT SQLNULLABLE.
02 nickname PIC X(10)
VALUE SQLNULL.
02 salary TYPE BINARY
NOT SQLNULLABLE.
02 hire-date TYPE SQL DATE
NOT SQLNULLABLE.
02 subordinate TYPE SQL VARCHAR 15
OCCURS 10 TIMES.
END.
01 B.
02 NAME PIC X(25).
02 FILLER PIC X(1).
02 NICKNAME.
03 INDICATOR PIC S9(4) COMP.
03 VALU PIC X(10).
02 SALARY PIC S9(4) COMP.
02 HIRE-DATE PIC X(10).
02 SUBORDINATE OCCURS 10 TIMES.
03 INDICATOR PIC S9(4) COMP.
03 VALU.
04 LEN PIC S9(4) COMP.
04 VAL PIC X(15).
03 FILLER PIC X(1).