EXEC P_ALTERPK 'PK_T_BD_CONFIGCODERULE', 'T_BD_CONFIGCODERULE', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_CONFIGCODERULE_FNUMBER') CREATE INDEX IDX_BD_CONFIGCODERULE_FNUMBER ON T_BD_CONFIGCODERULE ( FNUMBER );

EXEC P_ALTERPK 'PK_T_BD_CONFIGCODERULE_L', 'T_BD_CONFIGCODERULE_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_CONFIGCODERULE_L') CREATE INDEX IDX_BD_CONFIGCODERULE_L ON T_BD_CONFIGCODERULE_L ( FID,FLOCALEID );

EXEC P_ALTERPK 'PK_T_BD_CONFIGCODERULEENTRY', 'T_BD_CONFIGCODERULEENTRY', 'FENTRYID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_CONFIGCODERULEENTRY') CREATE INDEX IDX_BD_CONFIGCODERULEENTRY ON T_BD_CONFIGCODERULEENTRY ( FID );