SQL/MP Programming Manual for COBOL85

HP NonStop SQL/MP Programming Manual for COBOL85429326-004
7-1
7 Program Execution
This section describes the execution of a COBOL program containing embedded SQL
statements and directives in the OSS environment. The section provides details about
the required access permissions, the TACL DEFINES used, and the steps to run the
TACL RUN command. It further explains how to run a program at low PIN and how to
determine compatibility with the SQL executor.
Required Access Authority
To execute an SQL program file, you (or the creator process if you use the COBOL
CREATEPROCESS routine) must have this access authority:
Read and execute authority to the SQL program file
Read authority to the catalog in which the program is registered
Read authority to any catalogs in which tables or views used by the program are
registered for SQL statements that require automatic SQL recompilation
Using DEFINEs
Before running an SQL program file, you can specify DEFINE, PARAM, or ASSIGN
commands. This subsection describes DEFINEs; for information about PARAM and
ASSIGN commands, see the TACL Reference Manual.
You can use DEFINE names in an SQL program to specify the names of SQL catalogs
and objects (tables, views, indexes, partitions, and collations). Use a class CATALOG
DEFINE for a catalog and a class MAP DEFINE for an object.
You enable and disable DEFINEs by using the DEFMODE attribute. If DEFMODE is
ON when a program begins execution, the system propagates the current set of
DEFINEs from the process file segment (PFS) of your TACL process to the new
process. If DEFMODE is OFF, the system propagates only the =_DEFAULTS DEFINE
to the new process. To display the current DEFMODE setting, use the SHOW
DEFMODE command.
You can create, modify, delete, and display DEFINEs with TACL (or SQLCI)
commands, Guardian system procedures, and OSS shell commands. You can also
specify the =_SORT_DEFAULTS DEFINE to control sort operations.
You must set all DEFINE names used in SQL statements before SQL load time unless
your program uses execution-time name resolution.
To determine the DEFINE set used when an SQL program was compiled, use the
EXPLAIN DEFINES option of the SQLCOMP command.