cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete the Table Contents before inserting records into SQL table ?

Former Member
0 Kudos

Hello Experts,

I have a scenario where in I have to Pick up some records from SAP RFC & insert into SQL table.

i know how to do this scenario but the proble with this is before inserting we first have to ZAP the SQL table & insert a new records. One more twist is The Triggering is happening from SAP side with Sender RFC. If this would have been from SQL Side i could have written a Stored Procedure/ Trigger & could have called this before the SENDER JDBC communciation channel picks up the Triggering event from SQL side.

So how to do this scenarioin XI, First deleting all the Records of SQL table & then inserting the new reocrds. without using the BPM.

Regards,

Umesh

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Prateek,

How to call a stored procedure from XI. Pl. tell me in detailed since i am new to XI. Uptill now i have just written insert in statement1 etc.

My requirement is before starting the insertion it should first deletes the existing records of the SQL table & then starts the insertion of a new records.

pl. help me.

Regards,

Umesh

Former Member
0 Kudos

hi umesh,

you can achieve this by writing SQL query in message mapping level..

refer this link:

http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm

regards.

Former Member
0 Kudos
prateek
Active Contributor
0 Kudos

Why dont u use a stored procedure with both delete and insert statement at the receiver jdbc side?

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

Pl. explain me in detailed. how the stored procedure will work. because i want to delete all the records as STMT1 & insert N records as STMT2.

As per my understanding if this is a part of Canonical Structure of SQL XML (STMT1/STMT2) etc. Then the STMT1 should get executed once Where as STMT2 will get inserted N times. so how we can achieve this. ?

Regards,

Umesh

former_member192892
Active Contributor
0 Kudos

Hello Umesh,

[JDBC Stored Procedures|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1671] [original link is broken] [original link is broken] [original link is broken];

Kindly refer this blog for slolution.

Please write a stored proc to perform your business logic, and configure using the blog.