Hello, I am using Delphi2010 and TOracleDataSet to access tables in Oracle. My question is how do I insert rows to multiple tables? I was told to use the AppendRecord method. Here is an example:

Example of value statements (this has been shortened obviously):
Suffix := trim(edSuffx.text);
Salutn := trim(edDear.text);

Example of AppendRecord:

Example of the next table:
RepState := Trim(edRepState.text);
RepZip := Trim(edRepZip.text);


Now........there are two other tables also. These all work and all four tables are inserted like they should be but I am leary of what could happen. I think there should be some kind of code in between appending information to the four tables. For example, the unique key for all four tables is a casnumber. What if 2 tables insert just fine and then an error occurs inserting values in the third table and then I have 2 tables with rows and 2 tables without? Matching casenumbers will exist in the 2 that inserted rows but not the other two.

Please help and thanks in advance!

Data should be only one table according to principle of relational database and other tables should reference that table.

Hi and thanks for responding!

Do you mean as far as a master/detail relationship?

This article has been dead for over six months. Start a new discussion instead.