Getting the index to use it later
Let's I have a parent and a child tables.
I load some data into the parent table, so a new record is generated with its primary key.
As the private key is auto increment, I do not know the value of this index.
Now, I need to load some data into the child table, where there is a foreing key linked to the parent table primary key.
How can I get the value of the parent table primary key, in order to use it to load fata into the child table?
Parent table: "Customers"
Child table: "Orders"
Summarizing, I need to load data into both tables, my problem is because there is a "CustomerID" field I need to know from the parent table to be able to load the child table, and I do not know how to get it.
If there is another easier way to do it, much better!!
Thanks a lot!!!