SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
C-74
CONTROL QUERY Directive
WHERE CUSTOMER.CUSTNUM = ORDERS.CUSTNUM
STABLE ACCESS;
CONTROL QUERY Directive
CONTROL QUERY is an SQL compiler directive that controls plans for queries.
Options specify whether to resolve names at execution time or at SQL startup time,
whether to include hash join algorithms among algorithms considered for executing
queries, and whether to optimize query response time for returning a few rows or all
rows.
BIND NAMES { AT EXECUTION | AT STARTUP }
specifies when to resolve names of SQL objects and catalogs in DDL, DML, and
DSL (GET) statements and in DCL statements other than CONTROL TABLE:
The default is BIND NAMES AT STARTUP.
For a cursor, the execution time for the OPEN statement is considered the
execution time for the SELECT statement within the DECLARE CURSOR
statement. (Neither DECLARE CURSOR, FETCH, nor CLOSE causes name
resolution.)
BIND NAMES AT EXECUTION can lead to unnecessary automatic recompilations
unless you specify the CHECK INOPERABLE PLANS option when you explicitly
compile the program. For more information about name resolution and its
relationship to compilation options, see the SQL/MP programming manual for your
host language.
Note that BIND NAMES does not affect the host compiler directive INVOKE or the
DCL statement CONTROL TABLE.
{| BIND NAMES {AT EXECUTION} | AT STARTUP |}
CONTROL QUERY {| HASH JOIN { OFF | ENABLE | SYSTEM } |}
{| INTERACTIVE ACCESS { ON | OFF } |}
{| MDAM { ON | OFF } |}
AT EXECUTION Resolves names just before each statement executes
AT STARTUP Resolves names just before the first SQL statement of the
program executes (static SQL) or when the PREPARE or
EXECUTE IMMEDIATE executes (SQLCI and dynamic SQL)