cancel
Showing results for 
Search instead for 
Did you mean: 

Using UPDATE statement in Receiver JDBC adapter

Former Member
0 Kudos

Hello All,

I have the scenario Proxy to JDBC. This is Master data Interface.All the master data is loaded before itself in the receiver database side.

If any change happen to materials in SAP, Proxy will be called and sent to PI.

I have to just Update the records which is already there in the database.No Create is allowed. If the record is not there PI has to give error alert.

Thinking of if i use UPDATE statement in the receiver JDBC adapter, by default if the record is not present in the table JDBC adapter will be error out. Is this true?? Please suggest

Thanks & Regards

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Bhavana,

Have you considered using [UPDATE_INSERT|http://help.sap.com/saphelp_nwpi71/helpdata/en/44/7b6d32fde93673e10000000a114a6b/frameset.htm]?

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Sorry for the duplicate reply. Network slowness issue.

Edited by: Baskar Gopal on Mar 5, 2012 10:26 AM

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You can do this way.

Do the JDBC lookup using select query in the mapping and if the records available as lookup response then do the update in the jdbc receiver. This way you control whether you need update or not based on the lookup record. And you dont need to combine select and update in the jdbc receiver side and making the complex data structure. Hope that helps.

Proxy --> mapping jdbclook up --> Jdbc

Former Member
0 Kudos

Hello,

How abt the following option?

Create 2 mappings

1) One for JDBC Look up: Do look up and give the output of this first mapping to input to check the condition in 2nd mapping.

2) In Second mapping, check if any records exists or not based on the JDBC look up output value. If records exists then execute 2nd mapping , else will be error out.

Inputs are welcome on this

Regards

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Yes. Thatswhat I explained in the previous reply.

anupam_ghosh2
Active Contributor
0 Kudos

Hi,

Database will throw an error if you try to update non-existant data.

Better you try with "select" statement before update. If the select statement returns one or more rows then you can go for an update. You can call in a stored procedure to check if data is present and then update.

Regards

Anupam