Use the following procedure to create a command synonym table. Then see Entering command synonym definitions into the table for instructions on entering your synonyms and their definitions.
CREATE TABLESPACE DSQTSSN1 IN DSQDBCTL USING STOGROUP DSQSGSYN PRIQTY 100 SECQTY 20 LOCKSIZE PAGE BUFFERPOOL BP0 CLOSE NO
Running this query creates the table space DSQTSSN1. The storage group and database for this table space are also those for the table space containing Q.COMMAND_SYNONYMS.
You might be able to use DSQDBCTL.DSQTSSYN as a table space. The Q.COMMAND_SYNONYMS table resides in DSQDBCTL.DSQTSSYN.
CREATE TABLE COMMAND_SYNONYMS ( VERB CHAR(18) NOT NULL, OBJECT VARCHAR(31), SYNONYM_DEFINITION VARCHAR(254) NOT NULL, REMARKS VARCHAR(254) ) IN TBSPACE1
The columns can be in any order, and you can add a column for comments so users know what function each synonym performs.
COMMENT ON TABLE COMMAND_SYNONYMS IS 'SYNONYMS FOR R AND D'The phrase SYNONYMS FOR R AND D appears in the REMARKS column of the DB2 system catalog.
You do not need to add comments about your new table to the DB2 system catalog, but if you do, one comment might be about the table, others might describe the columns. For example, suppose that COMMAND_SYNONYMS has a column named AUTHID that distinguishes private from public synonyms. To add a comment to explain this, run a query:
COMMENT ON COLUMN COMMAND_SYNONYMS.AUTHID IS 'PRIVATE SYNONYM: USE AUTH ID. PUBLIC SYNONYM: USE NULL'
By running a subsequent COMMENT ON query, you can replace the current one. For more on COMMENT ON queries, see the DB2 UDB for OS390 Administration Guide.
CREATE UNIQUE INDEX SYNONYMS_INDEX ON COMMAND_SYNONYMS (VERB, OBJECT)
Index both the VERB and OBJECT columns with the UNIQUE keyword to prevent duplicate synonym definitions. If you choose not to use the UNIQUE keyword, QMF allows duplicate synonyms in the table; QMF uses the first synonym it locates in the table and displays a warning message on the QMF Home panel after initialization.