cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Scenario: Delete all the existing records and Insert

Former Member
0 Kudos

Dear All,

Scenario: IDoc to JDBC

PI need to delete all the existing records in the SQL table then need to insert the records.I have created a two statements in the target structure.

Statement1

-> TableName

-> action : DELETE

-> Table : TableName

Statement2

-> TableName

-> action : INSERT

-> Table : TableName

->Access

-> Elements

I am getting below error while try to delete the records in the table.

JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'Tablename' (structure 'Statement1'): java.sql.SQLException: FATAL ERROR document format: structure 'Statement1', no key element found

Note: we use above structure in the another interface without specifying any Key for Delete operation(Server is same but different database for this two interface) and it works fine. Although the Primary keys has been set in the SQL table i am getting the above error.

let me know what are the setting need to make in PI and SQL DB to achieve this.

Regards,

Manikandan Shanmugam

Edited by: Manikandan Shanmugam on Nov 8, 2011 6:19 AM

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

The straucture what you have deined for Delete is not correct, you should have key field in statement structure then only you can perform Delete operation.

refer below link

http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b6e85fde93673e10000000a114a6b/content.htm

Regards,

Raj

Former Member
0 Kudos

Dear Raja,

We can do it like above too as Mark replied and i can do delete operation without Key.

Regards,

Manikandan Shanmugam

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

In ID, open your JDBC Receiver CC and then uncheck the Key Tags Mandatory option under the processing tab.

Hope this helps,

Mark

Former Member
0 Kudos

Dear Mark,

Thanks for your answer and its solved now.

Regards,

Manikandan Shanmugam