cancel
Showing results for 
Search instead for 
Did you mean: 

File to JDBC - Trying to UPDATE_INSERT multiple records in database

former_member181962
Active Contributor
0 Kudos

Hi Experts,

   I have a simple file to JDBC scenario, where I am trying to update_insert multiple records in a database table.

I have created a message type which looks like :

target_mt

--------Statement

---------------------Table

------------------------------action

------------------------------Table

---------------------access (0:unbounded)

-----------------------------field1

-----------------------------field2

---------------------key (0:unbounded)

----------------------------field1

the source node looks something like this

source_mt

-------------record

-------------------row (0:unbounded)

---------------------------field1

---------------------------field2


I have mapped the row node to the access and key nodes of the target.

the action is UPDATE_INSERT.

However, only one record is being updated at the target side.

can someone please help me?

Best Regards,

Ravikanth Talagana

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

I don't think mapping Record/Row to access node will solve the problem.

So either map "row" to  "dbTableName" (first try this) or "statement node" (apparently, after changing the occ to 0..Unbounded)

<root>

  <StatementName1>

<dbTableName action=“UPDATE_INSERT”>

<table>realDbTableName</table>

<access>

<col1>val1</col1>

<col2>val2new</col2>

</access>

<key1>

<col2>val2old</col2>

<col4>val4</col4>

</key1>

<key2>

<col2>val2old2</col2>

</key2>

</dbTableName>

</StatementName1>

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Ravi

I think the probelm is with the occurrnece of Record in your source side. If Record occurs multiple time in source side, then you can map Record with access and this should solve your problem.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You need to keep statement node 1 to many with respect to number of records that is coming from the source (in your case row).  This should fix this problem.