cancel
Showing results for 
Search instead for 
Did you mean: 

DELETE && UPDATE JDBC

Former Member
0 Kudos

I am working on XML to JDBC scenario.From one xml i have to update few tables,but before that i have to delete all the tables.

Now when i file is picked by file adapter,How can i delete the data in tables and insert the file in the tables?

Let me know...

Thanks

Prabhakar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey Prabhakar

Use multi mapping and delete the content in one Message type and then insert the data using the other.

<StatementName>
<dbTableName action=u201DDELETEu201D>
<key1>
<col2>val2old</col2>
<col4>val4</col4>     
</key1>
<key2>
<col2>val2old2</col2>
</key2>
</dbTableName> 
  </StatementName>

 <StatementName>
<dbTableName action=u201DINSERTu201D>
<table>realDbTableName</table>
<access>
<col1>val1</col1>
<col2>val2</col2>
</access>
<access>
<col1>val11</col1>
</access>
</dbTableName> 
  </StatementName>

Thanks

Gaurav

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks Guys.I used INSERT_UPDATE in my scenario..

dharamveer_gaur2
Active Contributor
0 Kudos

Use Stored procedure

First delete all rows from table

then run insert statement.

use if else in condition in stored procedure.

Former Member
0 Kudos

Hi Venkat,

Write a Stored Procedure to delete the data from the table first and then insert the data into the table.

In the receiver structure you can use the action= execute and provide the Strored procedure name.

Regards

Sridhar Goli

Former Member
0 Kudos