Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-40
SQLNULLABLE
SQLNULLABLE
The SQLNULLABLE clause specifies that a line item is to be treated as an SQL-
nullable column. The NOTSQLNULLABLE clause specifies that a line item is not to be
treated as an SQL-nullable column.
In SQL, if a column is not explicitly specified as NOT NULL, it is a nullable column.
Internally, a nullable SQL column is composed of the column itself and a numeric flag
that indicates whether the column is null. The DDL compiler supports an SQL-nullable
line item in the same way: an SQL-nullable line item consists of the line item itself and
a numeric item that signals whether the item is null. Because of the presence of this
additional numeric item, an SQL-nullable item is word aligned; the internal byte size of
an SQL-nullable line item is the size specified plus 2.
Specifying SQLNULLABLE at the group level for definitions or records means that all
subordinate line items in the group are SQL-nullable, except for those individual line
items explicitly specified as NOT SQLNULLABLE. Specifying NOT SQLNULLABLE for
a group means that all its subordinate line items, except for those explicitly specified as
SQLNULLABLE, are not SQL-nullable; this condition also exists if no such specification
is made for the group.
The DDL compiler outputs an SQL-nullable line item as a group with two elementary
items in all of the supported host languages: Pascal (on D-series systems), C, COBOL,
FORTRAN, pTAL, TACL, and TAL. The name of the group is derived from the name of
the SQL-nullable line item. The names of the elementary items are indicator and valu.
The data type of indicator is the data type within the specific language that
corresponds to the DDL data type BINARY. The data type of valu is the language
output for the data type specified in the SQL-nullable line item.
The value for the null indicator is usually determined at run time. If your application
obtains Enscribe file layouts or SQL record schema from DDL, the recommended
values for the indicator item are:
The attributes SQLNULLABLE and NOT SQLNULLABLE applicable only to SQL, and
are not output for any of the supported languages, which do not recognize the
attributes in their syntax.
SQLNULLABLE or NOT SQLNULLABLE can be specified on a definition level, a group
level, or an elementary line item.
SQLNULLABLE and NOT SQLNULLABLE cannot be specified concurrently on the
same line item.
[NOT]SQLNULLABLE
Value Meaning
0 The value field contains meaningful data
-1 The data is null (not supplied)