 EXEC P_ALTERPK 'PK_T_MRP_DECUMENTS_DATAFIX', 'T_MRP_DECUMENTS_DATAFIX', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_DECUMENTS_DATAFIX') CREATE INDEX IDX_MRP_DECUMENTS_DATAFIX ON T_MRP_DECUMENTS_DATAFIX ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_MRP_DECUMENTS_DATAS', 'T_MRP_DECUMENTS_DATAS', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_DECUMENTS_DATASUB', 'T_MRP_DECUMENTS_DATASUB', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_DECUMENTS_DATASUB') CREATE INDEX IDX_MRP_DECUMENTS_DATASUB ON T_MRP_DECUMENTS_DATASUB ( FENTRYID ,FSEQ );
 

 EXEC P_ALTERPK 'PK_T_MRP_PRODUCTION_DATAFIX', 'T_MRP_PRODUCTION_DATAFIX', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_PRODUCTION_DATAFIX') CREATE INDEX IDX_MRP_PRODUCTION_DATAFIX ON T_MRP_PRODUCTION_DATAFIX ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_MRP_PRODUCTION_DATAS', 'T_MRP_PRODUCTION_DATAS', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_PRODUCTION_DATASUB', 'T_MRP_PRODUCTION_DATASUB', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_PRODUCTION_DATASUB') CREATE INDEX IDX_MRP_PRODUCTION_DATASUB ON T_MRP_PRODUCTION_DATASUB ( FENTRYID ,FSEQ );