TomBarrand
Programmer
My db consists of some of these tables and fields:
Purch_Ord_Hdr table Purch_Ord_Line table
Purch_Ord_No Purch_Ord_Line_No
Revision_No Purch_Ord_No
Status Revision_No
FOB table
FOB_No
Purch_Ord_Line_No
FOB_Date
What I would like to do is select all of the data from all of these tables that relates to a specific Purch_Ord_No and Revision_No and insert the data into all of the tables.
I can do this for Purch_Ord_Hdr and Purch_Ord_Line using INSERT INTO SELECT statement and replacing the Revision_No, but I can not do this for the FOB as this is related at Purch_Ord_Line level. If I use the same technique for the FOB table what actual happens is that new records are added to the FOB table, but they relate to the old Purch_Ord_Line_No 's as oppossed to the new Purch_Ord_Line_No. Any suggestions would be appreciated
Purch_Ord_Hdr table Purch_Ord_Line table
Purch_Ord_No Purch_Ord_Line_No
Revision_No Purch_Ord_No
Status Revision_No
FOB table
FOB_No
Purch_Ord_Line_No
FOB_Date
What I would like to do is select all of the data from all of these tables that relates to a specific Purch_Ord_No and Revision_No and insert the data into all of the tables.
I can do this for Purch_Ord_Hdr and Purch_Ord_Line using INSERT INTO SELECT statement and replacing the Revision_No, but I can not do this for the FOB as this is related at Purch_Ord_Line level. If I use the same technique for the FOB table what actual happens is that new records are added to the FOB table, but they relate to the old Purch_Ord_Line_No 's as oppossed to the new Purch_Ord_Line_No. Any suggestions would be appreciated