cancel
Showing results for 
Search instead for 
Did you mean: 

Delete and insert the data into database

Former Member
0 Kudos

Dear Experts,

I have a requairement to delete old data and insert the new data in to data base through PI.

kindly let me know how to create the DATA type for this requairement.

below are the fields in the database side.

MailID

Name

company

sal

address

any one kindly help me on this

Regards

Kiran

Accepted Solutions (1)

Accepted Solutions (1)

former_member182455
Active Contributor
0 Kudos

Hi Kiran,

you can create the DT like below, we have a same requairement and developed the same.

DT_Kiran....

- > Statementname

   ->TableName

      action  - Delete

      Table  -- Maintain the Tablename

- > Statementname1  - 1 to unbound

   ->TableName

      action  - Insert

      Table  -- Maintain the Tablename

      ->Access    1 to unbound

       MailID

      Name

      company

      sal

      address

Regards

Srinivas

Answers (4)

Answers (4)

naveen_chichili
Active Contributor
0 Kudos

Hi Kiran,

best approach is to use multiple inbound interfaces and use maintain order at runtime in your interface determination so that once your delete statement is executed the your insert will happen.

please check the below link for multimapping

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1...

Thanks,

Naveen

iaki_vila
Active Contributor
0 Kudos

Hi Kiran,

You would need to construct a SOAP - JDBC scenario. I say SOAP because seems that you need to delete/insert by yourself and you can do by SOAPui tool for example.

In the JDBC you can use the JDBC formats pointed in the SAP.HELP documentation:

Defining a DELETE Statement - Configuring the JDBC Adapter in the Integration Directory/PCK - SAP Li...

Defining an INSERT Statement - Configuring the JDBC Adapter in the Integration Directory/PCK - SAP L...

Have you got the JDBC drivers installed for the target database?

Have you got the DB connection ?

Check Riyaz's blog to introduction in this adapter SAP PI Adapter Series: JDBC Adapter Configuration

Regards.

Former Member
0 Kudos

Hi Inaki,

I got all the requairement, earlier we have used the stored procedure (SP) name in our configuration.

now the requairement is changed.

The scenario is FILE to JDBC, we are receiving multiple recards in single file every day. we need to pick the data and delete the old data befor updating the new data.

kindly let me know in this case how to create the structure in Data type.

Regards

Kiran

Former Member
0 Kudos

Hi Kiran

Could you update records instead? There is a feature of the JDBC adapter that lets you insert a record if it does not exist, or update the non-key fields if it does exist.

You set the action = "UPDATE_INSERT" instead of "INSERT"

link for receiver jdbc data format.

Document Formats for the Receiver JDBC Adapter - SAP NetWeaver Exchange Infrastructure - SAP Library

If you want to go with Delete and insert only then check these links.

SAP Library - Configuring the JDBC Adapter in the Integration Directory/PCK

Regards

Osman

binod8
Active Participant
0 Kudos

Hi Kiran,

Can you please give some more details on this. Is this database on SAP ECC system ?

Thanks,

Binod