SQL Programming Manual for TAL

NonStop SQL Statements and Directives
HP NonStop SQL Programming Manual for TAL527887-001
3-28
INVOKE
last^name CHARACTER(20) NO DEFAULT NOT NULL,
retire^date DATETIME YEAR TO DAY,
PRIMARY KEY empnum
)
CATALOG \sys.$vol.testcat ;
The compiler generates this structure template:
! Record Definition for table \SYS.$VOL.SUBVOL.EMPTBL
! Definition current at 16:06:49 - 05/17/90
STRUCT emptbl^rec (*);
BEGIN
INT empnum /SMALLINT UNSIGNED/;
INT first^name^i;
STRING first^name[0:14];
STRING last^name[0:19];
INT retire^date^i;
STRING retire^date[0:9];
END;
Using the NULL STRUCTURE Clause
This example uses the NULL STRUCTURE clause, which causes columns that contain
null values to be defined as structures. The NULL STRUCTURE clause assigns the
name INDICATOR to all indicator variables in the structure template.
The INVOKE directive with the NULL STRUCTURE clause:
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL INVOKE emptbl AS emptbl^rec NULL STRUCTURE;
EXEC SQL END DECLARE SECTION;
NonStop SQL generates this structure template:
! Record Definition for table \SYS.$VOL.SUBVOL.EMPTBL
! Definition current at 16:07:00 - 05/17/90
STRUCT emptbl^rec (*);
BEGIN
INT empnum /SMALLINT UNSIGNED/;
STRUCT first^name;
BEGIN
INT indicator;
STRING valu[0:14];
END;
STRING last^name[0:19];
STRUCT retire^date;
BEGIN
INT indicator;
STRING valu[0:9];
END;
END;