Creating synonyms for selected tables by importing DML - Documentation for ALTER and BMC AMI Change Manager for Db2 12.1

In an ISPF editor, type the DML statement to match the one shown in the following figure and provide the information that is unique to your site.

For information about DML syntax, see CM/PILOT Data Manipulation Language (DML).

Tip

You can copy the DML statement to create synonyms for selected tables from member ACMDMLU3 in the HLQ.BMCCNTL data set.

LIKE SYNONYM
JOIN SYSIBM.SYSTABLES
SET NAME = 'SYN_' CONCAT SUBSTR(SYSIBM.SYSTABLES,NAME,1,12), CREATOR = 'NEWSYN', TBCREATOR = SYSIBM.SYSTABLES.CREATOR, TBNAME = SYSIBM.SYSTABLES.NAME
WHERE SYNONYMS.CREATOR = 'RDACRJ' AND SYNONYMS.NAME = 'SY_T_PRODUCT01' AND LENGTH(SYSIBM.SYSTABLES.NAME) <= 12 AND SYSIBM.SYSTABLES.CREATOR = 'ALUQA'
;

In the preceding figure, the DML has been edited to join to the SYSIBM.SYSTABLES. The SET clause uses the SUBSTR function to use only the first 12 characters of the TABLE name. The WHERE clause has a LENGTH specification. The LENGTH check ensures that only tables whose names have an additional four characters added to the beginning of the name for the synonym are utilized.

You Might Also Like