 EXEC P_ALTERPK 'PK_T_FA_APPLY_REPAIR', 'T_FA_APPLY_REPAIR', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FA_APPLY_REPAIR_AAB') CREATE INDEX IDX_T_FA_APPLY_REPAIR_AAB ON T_FA_APPLY_REPAIR ( FASSETORGID ,FAPPLYDATE ,FBILLSTATUS );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FA_APPLY_REPAIR_BILLNO') CREATE INDEX IDX_T_FA_APPLY_REPAIR_BILLNO ON T_FA_APPLY_REPAIR ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FA_APPLY_REPAIR_RAB') CREATE INDEX IDX_T_FA_APPLY_REPAIR_RAB ON T_FA_APPLY_REPAIR ( FAPPLIERID ,FBILLSTATUS ,FAPPLYDATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FA_APPLY_REPAIR_S') CREATE INDEX IDX_T_FA_APPLY_REPAIR_S ON T_FA_APPLY_REPAIR ( FBILLSTATUS );


 EXEC P_ALTERPK 'PK_T_FA_APPLY_REPAIR_ENTRY', 'T_FA_APPLY_REPAIR_ENTRY', 'FENTRYID', '1';

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