C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-89
SQL
The pragma default settings are:
Usage Guidelines
For the native compilers, the SQL pragma can appear on the Guardian compiler
RUN command line or be specified with the -Wsql or -Wsqlcomp flag of the c89
utility. For the TNS C compiler, the SQL pragma can be specified at the start of the
source text, before any declarations or definitions except comments.
With the SQL pragma, exec and sql become C keywords. Note that decimal is a
predefined data type.
For native C, the SQL pragma implicitly specifies the EXTENSIONS pragma and
defines _TANDEM_SOURCE.
For native mode C, RELEASE1 cannot be specified.
For native mode C, the CPPSOURCE option is not supported.
If you specify the IEEE_FLOAT pragma, you cannot also specify the SQL pragma.
For TNS/E-targeted compilations, specifying the SQL pragma overrides the
floating-point default and TANDEM_FLOAT is used.
For compiling embedded SQL using the c89 utility in the OSS environment, there
are two related flags:
°
Use -Wsql to compile a source file containing embedded SQL.
°
Use -Wsqlcomp -o to run the SQLCOMP compiler on an executable file
containing SQL (specify the executable file with the -o option).
You can compile, link, and run SQLCOMP on a program in one step by specifying
both of these flags in one command line.
For more details about the interface from a C program to a NonStop SQL/MP
database, see the SQL/MP Programming Manual for C.
The SQL pragma pertains only to SQL/MP, and not to SQL/MX. For more details
about the interface from a native C or C++ program to a NonStop SQL/MX
database, see the SQL/MX Programming Manual for C and COBOL.
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler Not set Not set
G-series TNS c89 utility Not set for C,
N.A. for C++
Not set for C,
N.A. for C++
TNS/R native C and C++ compilers Not set for C,
N.A. for C++
Not set for C,
N.A. for C++
Native c89 utility Not set for C,
N.A. for C++
Not set for C,
N.A. for C++
TNS/E native C and C++ compilers Not set for C,
N.A. for C++
Not set for C,
N.A. for C++