HP NonStop SQL/MP Programming Manual page 148

For c
Table of Contents

Advertisement

Explicit Program Compilation
Running the SQL Compiler
Use the c89 utility to run the SQL compiler (sqlcomp) to explicitly compile embedded
SQL statements in the C object file. The SQL compiler validates the program file for
execution and registers the program in the PROGRAMS and USAGES catalog tables
using its Guardian ZYQ name.
With the D40 and later D-series product versions, the native c89 and TNS c89 utilities
use different flags to run the SQL compiler, as described next.
Using the Native c89 Utility
To compile a C program with embedded SQL statements using the native c89 utility,
include the -Wsql flag to specify the SQL pragma and the -Wsqlcomp flag to run the
SQL compiler:
c89 -Wsql=sqlmap,release2
-Wsqlcomp="catalog \$sql.sqlcat,recompileondemand" sqlprog.c
For more information about the native c89 utility, see the Open System Services Shell
and Utilities Reference Manual or the c89(1) reference pages.
Using the TNS c89 Utility
With the D40 and later D-series product versions, the TNS c89 utility also uses
different flags from earlier versions of the c89 utility. For example, to compile an SQL
program file without invoking the Binder program, specify the -Wsqlcomp flag to run
the SQL compiler by using the catalog $sql.sqlcat:
c89 -Wnobind -Wsql="catalog \$sql.sqlcat" sqlprog.c
For more information about the TNS c89 utility, see the reference pages by entering
this command:
man -M /nonnative/usr/share/man/ c89.1
Considerations for Running the SQL Compiler
Other considerations for using the c89 utility to invoke the SQL compiler:
You must precede a dollar sign ($) in a catalog name with the OSS shell escape
character (\). For example:
c89 -Wsqlcomp="catalog \$sql00.sqlcat" sqlprog.c
Although the SQL compiler accepts an OSS path name for an input object file, you
must use Guardian names or DEFINEs to refer to SQL objects and catalogs in
embedded SQL statements within the program.
The input object file to the SQL compiler can be either an OSS file (code 180) or a
Guardian file (code 101). However, if you specify a Guardian file as input, you must
use its OSS path name format:
/G/volume/subvolume/file-id
HP NonStop SQL/MP Programming Manual for C—429847-008
Using the c89 Utility in the OSS Environment
6-32

Advertisement

Table of Contents
loading

Table of Contents