EXEC P_ALTERPK 'PK_T_BD_CONFIGCODEATTR', 'T_BD_CONFIGCODEATTR', 'FID', '1';

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

EXEC P_ALTERPK 'PK_T_BD_CONFIGCODEATTR_L', 'T_BD_CONFIGCODEATTR_L', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_T_BD_CONFIGCODEATTRENTRY', 'T_BD_CONFIGCODEATTRENTRY', 'FENTRYID', '1';

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