cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC - table update_insert

Former Member
0 Kudos

Hi,

Scenario: proxy table - sql table update_insert

I am passing an internal table (example below 2 records). if the sql table is empty, the data is inserted (both records). If one record already exists, the first record i.e. vendor 8 is updated, however the second vendor is not inserted? Can someone help me?

The access and key fields are 1...unbounded - these fields I have mapped to the internal table records.

<?xml version="1.0" encoding="UTF-8" ?>

- <ns0:MT_Vendor xmlns:ns0="urn:www.bcx.co.za:SS:outbound:Vendors">

- <SAPVendor>

- <SAPVendor action="UPDATE_INSERT">

- <access>

<VENDOR>8</VENDOR>

<NAME>u</NAME>

<CITY />

<DISTRICT />

<POSTCODE />

<STREET />

<CONTACT />

<TELEPHONE />

<FAX />

<EMAIL />

<STATUS />

<COREG />

<COTAX />

<WEBADDR />

<POBOX />

<POCODE />

<CURRENCY />

<SAPIND>Y</SAPIND>

<SAPDATETIME>2008-10-28 11:02:04</SAPDATETIME>

</access>

- <access>

<VENDOR>9</VENDOR>

<NAME>y</NAME>

<CITY />

<DISTRICT />

<POSTCODE />

<STREET />

<CONTACT />

<TELEPHONE />

<FAX />

<EMAIL />

<STATUS />

<COREG />

<COTAX />

<WEBADDR />

<POBOX />

<POCODE />

<CURRENCY />

<SAPIND>Y</SAPIND>

<SAPDATETIME>2008-10-28 11:02:04</SAPDATETIME>

</access>

- <key>

<VENDOR>8</VENDOR>

</key>

- <key>

<VENDOR>9</VENDOR>

</key>

</SAPVendor>

</SAPVendor>

</ns0:MT_Vendor>

Thanks,,

Leanne

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Leanne,

Duplicate the whole <Statement> level tag (SAP Vendor in your case) and have a single access/key with in each <SAPVendor> tag.

Your target XML should look some thing like this

<SAPVendor>

<access>

<f1></f1>

</access>

<key>

<f2></f2>

</key>

</SAPVendor>

<SAPVendor>

<access>

<f1></f1>

</access>

<key>

<f2></f2>

</key>

</SAPVendor>

Regards,

Jaishankar

Answers (0)