cancel
Showing results for 
Search instead for 
Did you mean: 

Simple File to Database Scenario

Former Member
0 Kudos

Dear Experts

I am working on a File to Database scenario. My requirement is to update the database with latest information. For example

1. First day i got a file of 100 records...Insert all the 100 records.

2. Second day i will get 110 records (here 100 records is old data and 10 records is the delta). Now PI needs to lookup with DB and insert the updates of 100 records and insert the delta 10 records...

3. Third day i got 125 records file (here 110 is previous days data and 15 is todays delta). I need to update the changes of all the 110 and insert 15 delta records

Thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Since you want to update the existing records and insert the delta, the 'update_insert' option of JDBC receiver should fulfill your requirements.

Refer the following links for more help on this

Regards

Former Member
0 Kudos

Hi,

You can use action=UPDATE_INSERT on the reciever database (in mapping).

This statement will for existing records with key and updates. If the record is not present then it will insert that record.

You can refer the following link for more information:

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

Please let us know what issues you are facing with this approach..

Former Member
0 Kudos

Hi,

Instead of doing update of the existing records...

Use two statements one for deleting the existing data and other for the inserting the new data...

Try out the above option will work...

HTH

Rajesh

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Achuth,

Does it make sense, to send all records to target system and ask the target system to decide what records they need to updated. Target system can find new records based on timestamp (OR what every business logic).It is not advisable to do lookup for duplicates and update the same database (two DB calls).

If you want to archive exact requirement you have stated above, you can in message mapping you can do a JDBC lookup and filter out old data.

Regards,

Raghu_Vamsee