SQL/MP Programming Manual for C
Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for C—429847-008
6-7
Specifying the SQL Pragma in the Guardian
Environment
Specifying the SQL Pragma in the Guardian Environment
The SQL pragma indicates to the TNS C , the TNS/R NMC, or the TNS/E CCOMP
compilers that a program contains embedded SQL statements or directives and
specifies various options for processing the SQL statements or directives.
You can specify the SQL pragma either in your primary C source file or as a compiler
option in the implicit TACL RUN command for the TNS C compiler. When you run the
NMC or CCOMP compiler, you must specify the SQL pragma as a compiler option in
the NMC or CCOMP command.
This example shows the SQL pragma as a TNS C compiler option:
C / IN csrc, OUT $S.#clist / cobj; SQL
To specify the SQL pragma in your C source file, use:
WHENEVERLIST | NOWHENEVERLIST
controls the writing of active WHENEVER options to the listing file after each SQL
statement is processed.
WHENEVERLIST causes the options to be written.
NOWHENEVERLIST (the default) causes the options not to be written.
CHAR_AS_ARRAY | CHAR_AS_STRING
specifies whether the INVOKE directive generates character types that contain an
extra byte for the null terminator.
CHAR_AS_ARRAY directs INVOKE to generate character types without the extra
byte.
CHAR_AS_STRING (the default) directs INVOKE to generate character types with
the extra byte for the null terminator.
SQLMAP | NOSQLMAP
specifies whether the compiler listing includes an SQL map. This map enables you
to determine SQL statements using output from the Measure program.
#pragma SQL [ option ]
[ ( option [ , option ]... ) ]
option is:
[ WHENEVERLIST | NOWHENEVERLIST ]
[ CHAR_AS_ARRAY | CHAR_AS_STRING ]
[ SQLMAP | NOSQLMAP ]
[ RELEASE1 | RELEASE2 ]
[ CPPSOURCE "filename" ]