cancel
Showing results for 
Search instead for 
Did you mean: 

how to send data to two tables

Former Member
0 Kudos

Hi,

We have a requirement to send data to two different tables in the database using jdbc adapter from data files.

So we have one main data file as xml that will send same data to two different table.

How can we fulfill these requiement , please advise .

Thanks

Laxmi Bhushan

Accepted Solutions (1)

Accepted Solutions (1)

former_member208856
Active Contributor
0 Kudos

When we are posting data using JDBC adapter from PI.

We are using Mapping for Action = Insert

and giving Table = <tableName>.

Now you have to use mapping for 2 tables.

Pass the data in 2 structures, in first structure use First table & in secound structure use 2nd table.

You have to use 1:N mapping concept & in second structure use 2nd table.

Answers (4)

Answers (4)

Former Member
0 Kudos

Answered

Former Member
0 Kudos

On Receiver Side try to Create Such Node Structure :

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

<PrimaryInvoiceData> -


ROOTNODE STARTS----


<Update_Insert_INVHDR> -


TABLE A START----


<dbTable action="UPDATE_INSERT">

<table>INVHDR</table>

<access>

<VBELN>7468000071</VBELN>

</access>

<Key>

<VBELN>7468000071</VBELN>

</Key>

</dbTable>

</Update_Insert_INVHDR> -


TABLE A END -


<Update_Insert_INVDET> -


TABLE B START -


<dbTable action="UPDATE_INSERT">

<table>INVDET</table>

<access>

<VBELN>7468000071</VBELN>

</access>

<Key>

<VBELN>7468000071</VBELN>

</Key>

</dbTable>

</Update_Insert_INVDET> -


TABLE B ENDS -


</PrimaryInvoiceData> -


ROOTNODE ENDS----


this structure is with two tables : INVHDR , INVDET

Hope this help you ....

if found any problem ...please do post .....................................

regards

Prabhat Sharma

Former Member
0 Kudos

Hi Laxmi,

Create the Insert structure for JDBC in PI as below:

Suppose Insert_Structure is the structure you are creating.

Then hierarchy would be:

<Insert_Structure>

-


<statement1>

-


<row1>

-


<Action>

-


<table>

-


<access>

-


Field1

-


Field2

-

-

-


FieldN

-


</access>

-


</row1>

-


</statement1>

-


<statement2>

-


<row2>

-


<Action>

-


<table>

-


<access>

-


Field1

-


Field2

-

-

-


FieldN

-


</access>

-


</row2>

-


</statement2>

For Statement1, the action would be Insert and table will have the first table name.

Similarly, for Statement2, the action would be Insert and table will have the second table name.

These values will be hardcoded in mapping.

-Supriya.

Former Member
0 Kudos

Hi,

Plz refer this(look Praveen's reply):

Thanks

Amit