NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-36
Examples—DEFINEs Used With SQL Programs
Examples—DEFINEs Used With SQL Programs
The following example uses the DEFINE name =PARTS to identify a table in an
INVOKE statement in a COBOL85 program. The DEFINE for =PARTS must exist
when you run the preprocessor prior to the COBOL85 compilation.
EXEC SQL
INVOKE =PARTS AS PARTS-REC LEVEL (01,04)
END-EXEC.
The following example uses the DEFINE name =PARTS to identify a table in an
INSERT statement. The DEFINE for =PARTS must exist when you run the program
and should normally exist when you compile the program.
EXEC SQL
INSERT INTO =PARTS
VALUES (:PARTNUM OF PARTS,
:PARTDESC OF PARTS,
:PRICE OF PARTS,
:QTY-AVAILABLE OF PARTS)
END-EXEC.
The following example uses the DEFINE name =SCAT in a TACL command that
calls the SQL compiler. =SCAT identifies the catalog in which to register the
GEN generation-number Optional
LABELS Optional
{ANSI | IBM | OMITTED | BYPASS | BACKUP}
OWNER owner-id Optional
MOUNTMSG “text” Optional
RECFORM {F | U} Optional
RECLEN record-length Optional
REELS num-of-volumes Optional
RETENTION days Optional
SYSTEM \system-name Optional
TAPEMODE {STARTSTOP | STREAM} Optional
USE {IN | OUT | EXTEND | OPENFLAG} Optional
VERSION number Optional
VOLUME {volume-id | SCRATCH} Optional
Class Attributes
Required/
Optional