IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_SETOFFDIM_ENTRY_L')
 CREATE TABLE T_MDS_SETOFFDIM_ENTRY_L (
FPKID NVARCHAR(18) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREQFIELDNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FFIELDNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPROFIELDNAME NVARCHAR(200) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_MDS_SETOFFDIM_ENTRY_L', 'T_MDS_SETOFFDIM_ENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MDS_SETOFFDIM_ENTRY_L') CREATE INDEX IDX_MDS_SETOFFDIM_ENTRY_L ON T_MDS_SETOFFDIM_ENTRY_L ( FENTRYID ,FLOCALEID );

