SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-52
EXPLAIN Function
EXPLAIN Function
Considerations for EXPLAIN
Examples of EXPLAIN
The EXPLAIN function is a table-valued stored function that generates a result table
describing an access plan for a SELECT, INSERT, DELETE, UPDATE, or CALL
statement. See Result of the EXPLAIN Function on page 9-53.
The EXPLAIN function can be specified as a table reference (table) in the FROM
clause of a SELECT statement if it is preceded by the keyword TABLE and surrounded
by parentheses.
The EXPLAIN function is an SQL/MX extension.
'module-name'
is a character string that specifies the full name of a prepared embedded SQL
module, including the catalog name, schema name, and any module management
attributes. See the MODULE Directive on page 3-69. For more information on
module management attributes, see the SQL/MX Programming Manual for C and
COBOL.
The module name is enclosed in single quotes and is case-sensitive. If a module
name is uppercase, the value you specify within single quotes must be uppercase.
For example: 'MYCAT.MYSCH.MYPROG'
NULL
explains statements prepared in the MXCI session.
'statement-pattern'
is a character string that specifies the pattern for searching for the names of SQL
statements within the given module. If the module is specified as NULL, the pattern
string is used to match statement names that have been used in PREPARE
statements within the current MXCI session.
A statement pattern is enclosed in single quotes and is case-sensitive. The
statement name must be in uppercase, unless you delimit the statement name in a
PREPARE statement. The pattern can include wild-card characters as in a LIKE
pattern. See LIKE Predicate on page 6-93.
EXPLAIN (module,'statement-pattern')
module is:
'module-name'
| NULL
MXCI
MXCI