Installing and configuring the Optim data privacy user-defined functions for DB2 for Linux, UNIX, and Windows

The IBM® InfoSphere® Optim™ Data Privacy solution provides user-defined functions (UDFs) you can use to mask DB2® for Linux™, UNIX™, and Windows™ data.

The following tables list the names of the UDFs for masking DB2 for Linux, UNIX, and Windows data and their associated input and return data types.

The UDFs in the following table support only a single data argument with the data privacy provider input syntax.
Table 1. Single-argument UDFs for DB2 for Linux, UNIX, and Windows.

UDF Name Input data type Return data type
OptimMaskDate DATE DATE
OptimMaskDouble DOUBLE, 8-byte (When you use this UDF with the FLOAT data type, you must CAST the data to DOUBLE using DB2 built-in functions.) DOUBLE, 8-byte
OptimMaskInt16 SMALLINT SMALLINT
OptimMaskInt32 INTEGER INTEGER
OptimMaskInt64 BIGINT BIGINT
OptimMaskStr CHAR, VARCHAR CHAR, VARCHAR
OptimMaskStrInt CHAR, VARCHAR INTEGER
OptimMaskStrUTF16 GRAPHIC, VARGRAPHIC (supported only in Unicode databases) GRAPHIC, VARGRAPHIC
OptimMaskTimestamp TIMESTAMP TIMESTAMP
Note: The data privacy UDFs do not support the DB2 DECIMAL data type. To mask a DECIMAL value, you must explicitly CAST the data to a data type that is CASTable from DECIMAL (for example, CHAR or DOUBLE). All string-based UDFs (that is, OptimMaskStr, OptimMaskStrUTF16, and OptimMaskDouble) will work for DECIMAL values.

Use the multi-argument UDFs in the following table when you have more than a single column, expression, or literal as input to the UDF.

Table 2. Multi-argument UDFs for DB2 for Linux, UNIX, and Windows.

UDF Name Number of arguments Input data type Return data type
OptimMaskStr2 2 CHAR, VARCHAR CHAR, VARCHAR
OptimMaskStr3 3 CHAR, VARCHAR CHAR, VARCHAR
OptimMaskStr4 4 CHAR, VARCHAR CHAR, VARCHAR
OptimMaskStr5 5 CHAR, VARCHAR CHAR, VARCHAR
OptimMaskStr6 6 CHAR, VARCHAR CHAR, VARCHAR
OptimMaskStr2Int 2 CHAR, VARCHAR INTEGER
Note: In the OptimMaskStr, OptimMaskStrInt, OptimMaskStrUTF16, and all the multi-argument UDFs, the input length is set to 800 to accommodate the maximum size of an email that the Optim data privacy providers support.