You are not logged in.
I'm in a project to transport all the data from a database to another, where wich one has its own structure (name and data type).This would be pretty simple, but when you got a scenario like this:
|- Table 1
|- Table 2 (depends on a string code in Table 1)
ROW_SOURCE -->|- Table 3 (depends on a id generated in Table 2)
|- Table 4 (depends on a id generated in Table 2)
|- Table 5 (depends on the string code fro Table 1 AND the id generated in Table 2)
The context is about clients (Table 1 = Principal;
Table 2 = Complementary;
Table 3 = Auxiliar;
Table 4 = Address;
Table 5 = Auxiliar Address)
One row only will be commited if at least one row in each Table is recorded;
The target database can have the same client, when the rows must be updated;
One client can have multiple addresses;
If the address exist, the data will be updated, if not, will be inserted.
There's other things to do, like search in target database some data (ZIP code and other little things) from the source database and return the id , that could be missing in the target database, wich case, nothing will be recorded.
Right now I'm trying to solve the issue about the codes and ids, there isn't a Rollback yet and the Commit is just to give me an idea, but its just the start point.
This is the simplest scenario in this project and I'm already going nuts. Any help would be great.