Skip to Content
avatar image
Former Member

how to send data to two tables

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 08, 2010 at 11:13 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2010 at 11:40 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 08, 2010 at 11:25 AM

    Hi,

    Plz refer this(look Praveen's reply):

    ABAP proxy to jdbc

    Thanks

    Amit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2010 at 12:15 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2010 at 12:48 PM

    Answered

    Add comment
    10|10000 characters needed characters exceeded