cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Sender: Reading from two different Tables with one Stored Procedure

sherin_jose4
Participant
0 Kudos

Hello All,

Currently i have a JDBC to RFC scenario where the sender JDBC adapter has to read data from two different tables and populate data using stored procedure. The question i have is that when i read the data using stored procedure, i would be getting different data from two different tables and how should we create the data structure in this case. In a normal case we give a DocumentName parameter to define the recordset, but here i would be getting two different recordset.

For example, say i have the below two tables

Table1:

EmpID

EmpName

Location

Table2:

Company

Address

How should we create the data structures and is there any specific config that is required in Sender JDBC channel ?

Accepted Solutions (0)

Answers (4)

Answers (4)

iaki_vila
Active Contributor
0 Kudos

Hi Sherin,

From my own experience, i did a select in the SELECT box and later i call the stored procedure (with the same select that the select), i shared one example here ()

You would need to be able to do the selection with one select over the two tables.

Regards.

apu_das2
Active Contributor
0 Kudos

Hi Sherin ,

Your data structure should be as per stored procedure structure . It typically looks like below -

Statement

     <Stored Procedure Name>

           <Parameter Name>

                   IsInput

                   Type

Follow below screen taken from a blog -

Thanks,

Apu

Harish
Active Contributor
0 Kudos

Hi Sherin,

When we query the data from different table via stored procedure, then the best way is to create a view on database and define the data structure based on the view.

regards,

Harish

former_member190293
Active Contributor
0 Kudos

Hi, Sherin!

I'm not much experiensed in JDBC communication but I doubt JDBC adapter ability to process your request the way you want it.

Wouldn't you tell about your requirements? Do you need two separate datasets from different tables or these datasets are linked?

sherin_jose4
Participant
0 Kudos

Hi Evgeniy,

These datasets are actually linked and the target system should receive a single xml through RFC.

former_member190293
Active Contributor
0 Kudos

Ok. You can use JOIN class to combine data from two tables in one recordset and define common XML structure for result accordingly.

Regards, Evgeniy.