EXEC P_ALTERPK 'PK_BAS_COSTCENTERSOURCEMAP', 'T_BAS_COSTCENTERSOURCEMAP', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_CCTSOURCEMAP_CID') CREATE INDEX IDX_T_BAS_CCTSOURCEMAP_CID ON T_BAS_COSTCENTERSOURCEMAP ( FCOSTCENTERID );

EXEC P_ALTERPK 'PK_BAS_COSTCENTERSOURCEMAP_L', 'T_BAS_COSTCENTERSOURCEMAP_L', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_BAS_COSTCENTERMAPENTRY', 'T_BAS_COSTCENTERMAPENTRY', 'FENTRYID', '1';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_COSTCENTERMAPENTRY_SID') CREATE INDEX IDX_BAS_COSTCENTERMAPENTRY_SID ON T_BAS_COSTCENTERMAPENTRY ( FSOURCEDATAID );

EXEC P_ALTERPK 'PK_BAS_COSTCENTERFIELDMAP', 'T_BAS_COSTCENTERFIELDMAP', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_COSTCENTERFIELDMAP_BIS') CREATE INDEX IDX_BAS_COSTCENTERFIELDMAP_BIS ON T_BAS_COSTCENTERFIELDMAP ( FBUSINESSBILL );

EXEC P_ALTERPK 'PK_BAS_COSTCENTERFIELDMAP_L', 'T_BAS_COSTCENTERFIELDMAP_L', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_BAS_COSTCENTERFLDENTRY', 'T_BAS_COSTCENTERFLDENTRY', 'FENTRYID', '1';

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