hessodreamy
Programmer
I am well pleased with myself for having managed to load data from a text file into mysql. However have now come up against another problem.
One of the columns in the data file refers to a field in a table, but the table into which it is being inserted needs to extract the primary key relating to said data. Make sense?
The data in file has column 'productCode'.
However the table im inserting into has column 'productID', which is related to productCode in another table.
So what I'm wanting to do is insert from file (column1, column2, column3, (SELECT productID FROM products WHERE productID = productCode), column5....
Is this at all possible?
One of the columns in the data file refers to a field in a table, but the table into which it is being inserted needs to extract the primary key relating to said data. Make sense?
The data in file has column 'productCode'.
However the table im inserting into has column 'productID', which is related to productCode in another table.
So what I'm wanting to do is insert from file (column1, column2, column3, (SELECT productID FROM products WHERE productID = productCode), column5....
Is this at all possible?