/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_BJE_FACCOUNTBANKID') CREATE INDEX IDX_CAS_BJE_FACCOUNTBANKID ON T_CAS_BANKJOURNALENTRY ( FACCOUNTBANKID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PBTL_FLOCALEID') CREATE INDEX IDX_CAS_PBTL_FLOCALEID ON T_CAS_PAYMENTBILLTYPE_L ( FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PBTL_FNAME') CREATE INDEX IDX_CAS_PBTL_FNAME ON T_CAS_PAYMENTBILLTYPE_L ( FNAME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RBE_FSETTLEORGID') CREATE INDEX IDX_RBE_FSETTLEORGID ON T_CAS_RECEIVINGBILLENTRY ( FSETTLEORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RBE_FUNSETTLEDAMOUNT') CREATE INDEX IDX_RBE_FUNSETTLEDAMOUNT ON T_CAS_RECEIVINGBILLENTRY ( FUNSETTLEDAMOUNT );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RBE_FCOREBILLNO') CREATE INDEX IDX_RBE_FCOREBILLNO ON T_CAS_RECEIVINGBILLENTRY ( FCOREBILLNO );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_RECE_FITEMPAYERTYPEID') CREATE INDEX IDX_CAS_RECE_FITEMPAYERTYPEID ON T_CAS_RECEIVINGBILL_E ( FITEMPAYERTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_RECE_FINNERACCOUNTID') CREATE INDEX IDX_CAS_RECE_FINNERACCOUNTID ON T_CAS_RECEIVINGBILL_E ( FINNERACCOUNTID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PBE_FCOREBILLNO') CREATE INDEX IDX_CAS_PBE_FCOREBILLNO ON T_CAS_PAYMENTBILLENTRY ( FCOREBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PBE_FUNSETTLEDAMOUNT') CREATE INDEX IDX_CAS_PBE_FUNSETTLEDAMOUNT ON T_CAS_PAYMENTBILLENTRY ( FUNSETTLEDAMOUNT );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PAYMENTBILL_E_FFEEACTBANK') CREATE INDEX IDX_PAYMENTBILL_E_FFEEACTBANK ON T_CAS_PAYMENTBILL_E ( FFEEACTBANK );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PAYMENTBILL_E_FISWAITSCHE') CREATE INDEX IDX_PAYMENTBILL_E_FISWAITSCHE ON T_CAS_PAYMENTBILL_E ( FISWAITSCHE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PAYMENTBILL_E_FPAYMENTCNEL') CREATE INDEX IDX_PAYMENTBILL_E_FPAYMENTCNEL ON T_CAS_PAYMENTBILL_E ( FPAYMENTCHANNEL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PAYMENTBILL_E_FVOUCHERNUM') CREATE INDEX IDX_PAYMENTBILL_E_FVOUCHERNUM ON T_CAS_PAYMENTBILL_E ( FVOUCHERNUM );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_RECE_FRECEIVINGTYPEID') CREATE INDEX IDX_CAS_RECE_FRECEIVINGTYPEID ON T_CAS_RECEIVINGBILL ( FRECEIVINGTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_RECE_FCURRENCYID') CREATE INDEX IDX_CAS_RECE_FCURRENCYID ON T_CAS_RECEIVINGBILL ( FCURRENCYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_RECE_FACTRECAMT') CREATE INDEX IDX_CAS_RECE_FACTRECAMT ON T_CAS_RECEIVINGBILL ( FACTRECAMT );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_RECE_FORGID') CREATE INDEX IDX_CAS_RECE_FORGID ON T_CAS_RECEIVINGBILL ( FORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_RECE_FPAYERNAME') CREATE INDEX IDX_CAS_RECE_FPAYERNAME ON T_CAS_RECEIVINGBILL ( FPAYERNAME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PB_FBILLTYPEID') CREATE INDEX IDX_CAS_PB_FBILLTYPEID ON T_CAS_PAYMENTBILL ( FBILLTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PB_FSOURCEBILLTYPE') CREATE INDEX IDX_CAS_PB_FSOURCEBILLTYPE ON T_CAS_PAYMENTBILL ( FSOURCEBILLTYPE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PB_FPAYERACCTBANKID') CREATE INDEX IDX_CAS_PB_FPAYERACCTBANKID ON T_CAS_PAYMENTBILL ( FPAYERACCTBANKID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PB_FORGID') CREATE INDEX IDX_CAS_PB_FORGID ON T_CAS_PAYMENTBILL ( FORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PB_FPAYMENTTYPEID') CREATE INDEX IDX_CAS_PB_FPAYMENTTYPEID ON T_CAS_PAYMENTBILL ( FPAYMENTTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PB_FOPENORGID') CREATE INDEX IDX_CAS_PB_FOPENORGID ON T_CAS_PAYMENTBILL ( FOPENORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_BJ_FPERIODID') CREATE INDEX IDX_CAS_BJ_FPERIODID ON T_CAS_BANKJOURNAL ( FPERIODID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_BJ_FBANKACCTID') CREATE INDEX IDX_CAS_BJ_FBANKACCTID ON T_CAS_BANKJOURNAL ( FBANKACCTID );


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_constraint.sql **/
