EXEC P_ALTERPK 'PK_T_CAS_PAYMENTBILL_REV', 'T_CAS_PAYMENTBILL_REV', 'FENTRYID', '1';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_PAYBILL_REV_REVID_EID') CREATE UNIQUE INDEX IDX_CAS_PAYBILL_REV_REVID_EID ON T_CAS_PAYMENTBILL_REV ( FREVID ,FPENTRYID );


EXEC P_ALTERPK 'PK_T_CAS_AGENTPAYBILL_REV', 'T_CAS_AGENTPAYBILL_REV', 'FENTRYID', '1';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_AGENT_REV_REVID_EID') CREATE UNIQUE INDEX IDX_CAS_AGENT_REV_REVID_EID ON T_CAS_AGENTPAYBILL_REV ( FREVID ,FPENTRYID );


EXEC P_ALTERPK 'PK_T_CAS_REFUND_OPLOG', 'T_CAS_REFUND_OPLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CRO_REVNO') CREATE INDEX IDX_CAS_CRO_REVNO ON T_CAS_REFUND_OPLOG ( FREVBILLNO );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CRO_BILLNO') CREATE INDEX IDX_CAS_CRO_BILLNO ON T_CAS_REFUND_OPLOG ( FREFUNDBILLNO );


EXEC P_ALTERPK 'PK_T_CAS_REFUND_OPLOG_ENTRY', 'T_CAS_REFUND_OPLOG_ENTRY', 'FENTRYID', '1';

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