cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC multiple table insert each with multiple records

katie_doody2
Participant
0 Kudos

Hi, I am trying to do a multiple table insert with each table being able to have multiple records inserted. The first record for each table is the only record being inserted. I think my structure is correct but that I have a mapping problem. What should be the repeating parts? Just the access and key or the whole update_insert statement?

Thanks,

Katie

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

your structure dont look correct.. it should be as follows

Defining an UPDATE_INSERT Statement - Configuring the JDBC Adapter in the Integration Directory/PCK ...

<DT>

  <StatementName 1-unbounded>

       <TableName action = "">

            <table></table>

             <Accesss>          </ACcess>

             <key>     </Key>

    </StatementName>   

For update_Insert you should repeat the <StatementName>

katie_doody2
Participant
0 Kudos

Okay, i just added "message" (statement) to look like the structure you sent? I need to remove it now?

Former Member
0 Kudos

My bad sorry.. can you share your Message Mapping Target structure.. (without sample data)

katie_doody2
Participant
0 Kudos

Here it is after adding message:

Thanks, Katie.

Former Member
0 Kudos

Ok structure is not correct.. please follow as below.

1.  in your case <DT_CAZ_.. > is STATEMENTNAME., So no need to add Message <tag>

2. Remove the Message from your struct.

3, It should show as 

          <MT_MobRep>

             <DT_>

                   <insert>

                         <table>

                          <Access>

4. Please go with one at a time.. disable other structure in your mapping test first with insert..

former_member441596
Participant
0 Kudos

Hi,

Please follow the below structure, configure the scenario and test it.

Thanks & Regards,

Naidu

AlexanderApel
Participant
0 Kudos

Hi Katie,

here an example how i use sql

regards,

Alex

katie_doody2
Participant
0 Kudos

I reverted all my changes back and the insert is working again but to do this, I also have to have the access repeat to insert multiple records for each table. I am able to successfully insert multiple records into each table. The problem I have is when I do an update and I need to repeat the key and access. The message comes like:

<access></access>

<access></access>

<key></key>

<key></key>

when it should be

<access></access>

<key></key>

<access></access>

<key></key>

Here is my insert.

Here is my update:

I also have to suppress E1EDC01 when posex is 000000000 so maybe this is where my problem is. I need access and key to repeat as one unit.

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Katie,

I think your structure is wrong.

The action/access/key tags have to be repeated with each update_insert. Check this blog

In this document (Defining an UPDATE_INSERT Statement - Advanced Adapter Engine - SAP Library😞


Enter the new column values in the <access> element. Enter exactly one <access>element. 

Regards.

katie_doody2
Participant
0 Kudos

I changed my structure which I am using for both insert and update. My insert is now failing? The error is that the action attribute is missing or the xml structure is wrong. My insert was working before.

Do the insert and the update_insert need different structures?