Posted by: ndandala | May 28, 2009

Why Do You Need To Run the EIM Import Twice To Set Certain Foreign Keys?


You need to run the Enterprise Manager Integration (EIM) Import process twice when there are two non-target base tables mapped to one interface table and one non-target base table has a foreign key to a column in the other non-target base table. In this scenario, the data in the same row of the interface table cannot be inserted into the two base tables in one EIM batch or session.


The reason you need to run EIM twice is because during step 4 of the EIM Import process, the non-target parent base table is queried to resolve the foreign key of the non-target child base table, but the new row in the parent table has not yet been inserted. Therefore, when the first EIM process is run, you may receive errors in your EIM log file indicating a failure to resolve foreign keys, similar to the following:
This is a foreign key value in the base table and the values in the interface table did not resolve to existing values. Verify that the IF columns correspond to existing base table rows.
Solution
To import rows into the two non-target base tables with a foreign key reference, you need to run this EIM Import process twice, or use two import sessions in one batch. The first import inserts the new parent row in the non-target parent base table, and the second import inserts the new child row in the non-target child base table.
Example
An example that illustrates this scenario is inserting data from a row in the EIM_CONTACT table into S_PARTY, S_CONTACT, S_ADDR_PER, and S_CON_ADDR. In Siebel Industry Applications 7.5, the EIM_CONTACT interface table mapping does not allow you to complete this import in one batch because the foreign key column ADDR_PER_ID of the non-target child base table S_CON_ADDR points to the corresponding row ID in the non-target parent table S_ADDR_PER. To import this row and set the foreign key correctly, you should run the first EIM import process to insert the row into S_PARTY, S_CONTACT, S_ADDR_PER, then run a second EIM import session to set the foreign key in the S_CON_ADDR table.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: