SQL/MP Programming Manual for COBOL
Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL—529758-003
6-43
Using CONTROL Directives
FILE guardian-name
... ...
In the next example, the SQL compiler writes an execution plan and DEFINEs to the 
spooler location $S.#EXPLAIN. The OBEYFORM option directs the compiler to write 
the DEFINEs in OBEY command file format to the file named SETDEFS for 
subsequent execution. The catalog name is not included in the SQLCOMP command 
because it is stored in the program file. The NOOBJECT option suppresses the 
generation of a new object file, so the SQL compiler does not register the program file 
in a catalog.
SQLCOMP /IN SQLPROG,OUT $S.#EXPLAIN/ NOOBJECT,
 EXPLAIN PLAN DEFINES SETDEFS, OBEYFORM 
For more information about the EXPLAIN utility, including detailed examples and 
reports, see the SQL/MP Query Guide. 
Using CONTROL Directives 
You can use these CONTROL directives with either static or dynamic SQL statements 
in a COBOL program: 
CONTROL EXECUTOR
allows or prohibits parallel execution of a query by multiple SQL executors. Parallel 
execution can decrease the elapsed time for processing a query. 
CONTROL QUERY
controls query execution plans as follows: 
Optimization of query response time for returning only the first few rows found 
or for returning all rows found 
Use of hash join algorithms in execution plans 
Use of execution-time name resolution to resolve names in execution plans 
when the SQL statement executes rather than during explicit SQL compilation 
or at SQL load time 
CONTROL TABLE
controls these performance-related options for accessing tables and views:
Selection of access paths, join methods, join sequences, and lock types
Selection of block buffering and block splitting algorithms
Action to take for locked data or unavailable partitions 
Opening of indexes and partitions at the initial access to a table
Checkpointing of unaudited write operations
The use of CONTROL directives in a COBOL program is discussed next. For the 
syntax of each CONTROL directive, see the SQL/MP Reference Manual.










