ADB2FMP stored procedure
The ADB2FMP stored procedure formats SQL statements so that they are easy to read.
Environment
The ADB2FMP stored procedure runs in a WLM-established stored procedure address space. For setup instructions, see Setting up the provided REST APIs.
Authorization
To execute the CALL statement, the owner of the package or plan that contains the CALL statement must have EXECUTE privilege on the ADB2FMP stored procedure.
Syntax
Input parameters
- sqlstmt
- The SQL statement to be formatted. Supported statements are CREATE
statements and ALTER statements.
- Type:
- CLOB(2M)
- debug
- The debug level. Use 0 (zero) for normal operations. Other values are for
serviceability, as instructed by IBM® Software Support.
- Type:
- SMALLINT
Output parameters
- rc
- The return code.
- Type:
- INTEGER
- msg
- An optional error message.
- Type:
- VARCHAR(1331)
Result set
The result set includes the formatted SQL statement. It uses a cursor named RES_C and contains the following columns:
Column | Description |
---|---|
SEQ
INTEGER |
The sequence number in the SQL |
LINE
VARCHAR(80) |
The SQL line output |
Examples
The following example CALL statement specifies an SQL statement to be formatted:
CALL ADB2FMP(‘CREATE DATABASE TEST BUFFERPOOL BP1 INDEXBP BP2 STOGROUP SYSDEFLT’,0,:rc,:msg);