cancel
Showing results for 
Search instead for 
Did you mean: 

Structure for Receiver Jdbc adapter for multiple tables

Former Member
0 Kudos

Hi,

For Receiver JDBC adapter,Standard structure

structure as

Statement

Tablename(TABLE1)

Action

Access

Can i make a structure like

Statement

Tablename(TABLE1)

Action

Access

fields....

Tablename(TABLE2)

Action

Access

fields......

As i am using tables and I want to insert or update both of them or one based on some conditions.

Will Insert be possible in single Statement or I have to create separate statements for each table. Can you please help me on this?

Thanks in advance

Best Regards,

Harleen Kaur Chadha

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Harleen

PI understand Statement occurance as a single statement and it will not accept multiple statements with single occurance of Statement field. Its how Open SQL work with XI.

If you want to perform multiple statements in one. You can use Native SQL through adapter.

<StatementName6>

<anyName action=u201D SQL_QUERYu201D | u201CSQL_DMLu201D>

<access>SQL-String with optional placeholder(s)</access>

<key>

  <placeholder1>value1</placeholder1>

  <placeholder2>value2<placeholder2>

</key>

 </anyName >  

  </StatementName6>

This can also be one of the way to perform multiple tasks.

Thanks

Gaurav

wilsonrsantos
Active Participant
0 Kudos

Hi Harleen,

As already said by Dharanveer, all that you need to do is replicate the Statement level, so, istead of using this structure:

Statement

Tablename(TABLE1)

Action

Access

fields....

Tablename(TABLE2)

Action

Access

fields......

You will construct something like this:

Statement1

Tablename(TABLE1)

Action

Access

fields....

Statement2

Tablename(TABLE2)

Action

Access

fields......

And this structure will be created in a single Data Type, that will be used to create a single Message Type, that you will use in your Message Mapping, and, the 2(or more tables that you need to manipulate) will be inserted/updated without problems using this approach.

Thank you, and best regards,

Wilson

dharamveer_gaur2
Active Contributor
0 Kudos

Hi

As i mentioned in my previous reply Statement contains Table name,Action and Column name.

Yes This information is used for Generating runtime SQL query.

prateek
Active Contributor
0 Kudos

Use multiple Statement tags. Use UPDATE_INSERT as the action.

Regards,

Prateek

Former Member
0 Kudos

Hi,

Thanks for your reply I have one question,why we cant have multiple tables inside one Statement?

Is the query will be created based on statement?

Best Regards,

Harleen Kaur Chadha

prateek
Active Contributor
0 Kudos

A correction!! There will be a root node above Statement node. So then for multiple Statement tags, you won't face any problem.

You cannot use multiple table fields. XI expects it that way

Regards,

Prateek

dharamveer_gaur2
Active Contributor
0 Kudos

Hi

As you shown sturcture will work for multiple tables. You must need to repeat Structure of Whole Statement for each table, that includes Table name, Action and Fields name.

So Create multiple Statement for diffrent table.