/**Begin D:\PDM_UPGRADE\PDM1\HOM_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_ONBRDBILL_FPRBILLID') CREATE INDEX IDX_HOM_ONBRDBILL_FPRBILLID ON T_HOM_ONBRDBILL_B ( FPRBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_ONBRDBILL_FPRBATCHBILL') CREATE INDEX IDX_HOM_ONBRDBILL_FPRBATCHBILL ON T_HOM_ONBRDBILL_B ( FPRBATCHBILLID );

 EXEC P_ALTERPK 'PK_T_HOM_PREBATCHONBRDBILL_L', 'T_HOM_PREBATCHONBRDBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_HOM_PREBATCHONBRDBILL', 'T_HOM_PREBATCHONBRDBILL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_HOM_PREONBRDBILL', 'T_HOM_PREONBRDBILL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_HOM_PREONBRDBILL_A', 'T_HOM_PREONBRDBILL_A', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_HOM_PREONBRDBILL_L', 'T_HOM_PREONBRDBILL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_PREONBRDBILL_L_0') CREATE INDEX IDX_HOM_PREONBRDBILL_L_0 ON T_HOM_PREONBRDBILL_L ( FENTRYID ,FLOCALEID );



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