/**Begin D:\PDM_UPGRADE\PDM1\CAS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_CAS_PAYAPPLYBILL', 'T_CAS_PAYAPPLYBILL', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PAB_DATEORG') CREATE INDEX IDX_CAS_PAB_DATEORG ON T_CAS_PAYAPPLYBILL ( FPAYORGID ,FAPPLYDATE );

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


 EXEC P_ALTERPK 'PK_T_CAS_PAYAPPLYENTRY', 'T_CAS_PAYAPPLYENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PAE_FNUM') CREATE INDEX IDX_CAS_PAE_FNUM ON T_CAS_PAYAPPLYENTRY ( FEPAYEEACCBANKNUM );


 EXEC P_ALTERPK 'PK_T_CAS_PAYAPPLYPAIDENTRY', 'T_CAS_PAYAPPLYPAIDENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PAPE_FPAYMENTID') CREATE INDEX IDX_CAS_PAPE_FPAYMENTID ON T_CAS_PAYAPPLYPAIDENTRY ( FPAYMENTID );



/**End D:\PDM_UPGRADE\PDM1\CAS_constraint.sql **/
