How to see the column masks being used by a table using RC/Query
search cancel

How to see the column masks being used by a table using RC/Query

book

Article ID: 32047

calendar_today

Updated On:

Products

RC/Query for DB2 for z/OS

Issue/Introduction

With RC/Query for Db2 for z/OS (RCQ) release r19, new reports for Row Permission and Column Masks for a table are available.
The report names are T-PM (Table Permissions and Masks), PM-D(Permission and Mask Details) & PM-L(Permission & Mask List).


Here is a sample of the Table(T), Permission and Mask(PM) report.

  DB2 Object ===> T                       Option  ===> PM   Where => N

  Table Name ===> *                     > Creator ===> authid                 >

    PM Owner ===> *                     > N/A     ===> *                      >

 Loc: LOCAL ---------- SSID: ssid ----------AUTHID  -          LINE 1 OF 2    >

 CMD      TBNAME              TBSCHEMA  PM NAME             PM OWNER

 ________ COLMASK             authid

 DDL_____                               COLMASK             authid




A DDL line command on the mask(2nd line above) produces:

 

SET CURRENT SQLID = 'authid';

CREATE MASK authid.COLMASK

        ON authid.COLMASK

        FOR COLUMN COL2_INTEGER RETURN

CASE WHEN (COL1_SMALLINT = 1) THEN 9999 ELSE COL2_INTEGER END

ENABLE;

Resolution

A PM/D report also shows the details of the mask:

  DB2 Object ===> PM                      Option  ===> D    Where => N

     PM Name ===> *                     > Schema  ===> authid                >

    PM Owner ===> *                     > N/A     ===> *                      >

 Loc: LOCAL ---------- SSID: ssid ----------authid -         FRAME 1 OF 1

 ********************************* TOP OF DATA ********************************

 CMD: ________

      NAME : COLMASK

     SCHEMA : authid                     OWNER TYPE: AUTHID

     OWNER : authid

     TBNAME : COLMASK

   TBSCHEMA: authid

 TB CORREL :

 RULE TYPE : COLUMN MASK                  COL NAME : COL2_INTEGER

  ENFORCED : A                            IMPLICIT : N

   ENABLE  : Y         STATUS  :         RELCREATED: DB2v10

  CREATEDTS: 2015-10-07-03.09.20.514203   ALTEREDTS: 0001-01-01-00.00.00.000000

 RULE TEXT : CASE WHEN (COL1_SMALLINT = 1) THEN 9999 ELSE COL2_INTEGER END

Additional Information