I’m trying to implement a bulk upload feature to my database from a web frontend and I’d like to insert data into multiple tables where there is a 1:m relationship. The foreign key in the table on the many side of the relationship is an auto increment attribute in 1 side of the relationship.
For example:
table1 has a 1:m relationship to table2
table1
ID auto increment, primary key
Data varchar(50)
table2
ID auto increment, primary key
Table1_fk int
Data varchar(100)
Is there a way data could be bulk loaded into these tables from say, a tab delimited file? I have generated a bulk upload feature which takes columns from a file as the attributes to a particular table and this works where for example table1.ID is a user defined attribute, as the attribute can be included in an uploaded data file and used in the relationship. However, I can’t see an obvious way to do this if the attribute is an auto increment field.
Any thoughts!?
Cheers
Nath