Previous Topic: ExampleNext Topic: Example


DATACOM DUMP Statement

The DATACOM DUMP statement can be used as a debugging tool for SQL Procedures. This statement causes requested information to be dumped to a specified file and marked by a header and footer as shown in the first and last lines in the example in Example. The plan name that is shown in the dump report matches the SQL-name of your procedure.

►►─ DATACOM DUMP ─ dumpable-expression-list ─ TO PXXSQL ──────────────────────►◄

Expansion of Where dumpable-expression-list is defined as

   ┌─ , ──────────────────────┐
├──▼─┬─ SQL-variable-names ─┬─┴────────────────────────────────────────────────┤
     ├─ parameter-names ────┤
     ├─ special-registers ──┤
     ├─ literals ───────────┤
     └─ scalar-functions ───┘
dumpable-expression-list

A list, separated by commas, of SQL-variable-names, parameter-names, special-registers, literals, and scalar-functions.

TO PXXSQL

PXXSQL is the destination supported by the DATACOM DUMP statement. TO PXXSQL causes output to go to the PXX location to which SQL output is sent. The destination of SQL output is either specified using the Multi-User startup option SYSOUT (see the CA Datacom/DB Database and System Administration Guide) or allowed to default.

SQL-variable-names

The SQL-variable-names is the name of a variable that is declared within a compound statement inside a SQL Procedure (a LANGUAGE SQL procedure). If the name conflicts with (matches) another SQL variable name from a nested compound statement (for example, a condition handler), or an SQL parameter name, or a column contained within a referenced table or view, the SQL variable name should be qualified using the start-label of the compound statement that immediately contains it.

parameter-names

The parameter-names variable refers to any parameter in your procedure.

special-registers

For information about special registers.

literals

For information about literals, see literals.

scalar-functions

For information about scalar functions, see scalar functions.

Note: When using scalar functions, operands can include SQL variables and parameters but not column names. Fetching the value of a column into a variable is a suggested way to use a scalar function.