Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 38
SQLNULLABLE Clause
SQLNULLABLE Clause
The SQLNULLABLE clause specifies whether a line item is to be treated in the same
way 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. DDL 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.
DDL outputs an SQL-nullable line item as a group with two elementary items in all of
the supported host languages: C, COBOL, FORTRAN, Pascal, 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 the indicator
item 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 generally determined at run time. If, however, 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 are not output for any of the
supported languages, because none of those languages recognize the attributes in
their syntax; the attributes are applicable only to SQL.
SQLNULLABLE Clause Guidelines
The following are guidelines for using SQLNULLABLE and NOT SQLNULLABLE:
•
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.
{ SQLNULLABLE | NOT SQLNULLABLE }
0
The value field contains meaningful data
-1
The data is null (not supplied)