Start of change

ADB2FMM stored procedure

The ADB2FMM stored procedure applies the specified masks to an SQL statement and returns the formatted statement.

Environment

The ADB2FMM 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 ADB2FMM stored procedure.

Syntax

Read syntax diagramSkip visual syntax diagram CALL ADB2FMM ( sqlstmt,mask,debug,rc,msg, )

Input parameters

sqlstmt
The SQL statement to be masked.
Type:
CLOB(2M)
mask
A string that contains one or more mask definitions. For example: TBNAME:ABC*,DEF*;TSNAME:ABC*,DEF*

For information on how to specify masks, see Mask definitions.

Restrictions:
  • A semicolon cannot be used as a single-character mask.
  • Verification (VER) masks are ignored.
Type:
VARCHAR(32K)
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 masked and formatted SQL statement. It uses a cursor named C_RES 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 masked:

CALL ADB2FMM(‘CREATE DATABASE XXX STOGROUP XXX’,'DBNAME:XX*,YY*;SGNAME:XX*,ZZ*',0,:rc,:msg);

For this example, ADB2FMM returns the following SQL statement in the result set:

CREATE DATABASE YYX STOGROUP ZZX
End of change