/**Begin D:\PDM_UPGRADE\PDM1\PUR_constraint.sql **/
 EXEC P_ALTERPK 'PK_PUR_EXAMINE', 'T_PUR_EXAMINE', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_EXAMINE_FBILLDATE') CREATE INDEX IDX_PUR_EXAMINE_FBILLDATE ON T_PUR_EXAMINE ( FBILLDATE );


 EXEC P_ALTERPK 'PK_PUR_EXAMINE_A', 'T_PUR_EXAMINE_A', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_EXAMINE_A_FTIME') CREATE INDEX IDX_PUR_EXAMINE_A_FTIME ON T_PUR_EXAMINE_A ( FCREATETIME );


 EXEC P_ALTERPK 'PK_PUR_EXAMINE_L', 'T_PUR_EXAMINE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_IMPROVE', 'T_PUR_IMPROVE', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_IMPROVE_FBILLDATE') CREATE INDEX IDX_PUR_IMPROVE_FBILLDATE ON T_PUR_IMPROVE ( FBILLDATE );


 EXEC P_ALTERPK 'PK_PUR_IMPROVE_A', 'T_PUR_IMPROVE_A', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_IMPROVE_A_FTIME') CREATE INDEX IDX_PUR_IMPROVE_A_FTIME ON T_PUR_IMPROVE_A ( FCREATETIME );


 EXEC P_ALTERPK 'PK_PUR_IMPROVE_L', 'T_PUR_IMPROVE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY', 'T_PUR_QUALITY', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_QUALITY_FBILLDATE') CREATE INDEX IDX_PUR_QUALITY_FBILLDATE ON T_PUR_QUALITY ( FBILLDATE );


 EXEC P_ALTERPK 'PK_PUR_QUALITY_A', 'T_PUR_QUALITY_A', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_QUALITY_A_FTIME') CREATE INDEX IDX_PUR_QUALITY_A_FTIME ON T_PUR_QUALITY_A ( FCREATETIME );


 EXEC P_ALTERPK 'PK_PUR_QUALITY_EQUIP', 'T_PUR_QUALITY_EQUIP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_L', 'T_PUR_QUALITY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_LINK', 'T_PUR_QUALITY_LINK', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_MANAGE', 'T_PUR_QUALITY_MANAGE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_MAT', 'T_PUR_QUALITY_MAT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_PACK', 'T_PUR_QUALITY_PACK', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_SHIP', 'T_PUR_QUALITY_SHIP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_STORE', 'T_PUR_QUALITY_STORE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_QUALITY_TECH', 'T_PUR_QUALITY_TECH', 'FENTRYID', '1';

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



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