cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert data in to database table depends on Indicator

Former Member
0 Kudos

Hi All,

I am working on Idoc to JDBC scenario. I am collecting & bundling(Using BPM) all the idocs and inserting the data in to the different database tables. Up to now my scenario is working fine. Now the problem is before inserting the data I have to check one of the Table field. If the field indicator is u201CYESu201D then only I have to insert data otherwise I have to wait up to the indicator field needs to be changed. Once indicator is u201CYESu201D then I have to insert all the collected idocs in to the database tables.

Can you please let me know how can I achieve this?

Thanks & Regards,

Purushotham

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can put a condition in mapping

use createIf, with condition indicator = YES,

Map output of createIf to root node at target

condition(IFWithoutElse)-> createIf> MT_target

Former Member
0 Kudos

Hi Kulkarni,

I am not getting that indicator "YES" from the source. I have to check that indicator in the receiver side. If it is "YES" then only i have to insert all the idocs data in to the tables in receiver side.

Thanks & Regards,

Purushotham

Former Member
0 Kudos

Hi

I believe you would be using some sql statement to insert and update in the JDBC side,.

Why don't you just write a sql query at the receiver jdbc communicatio channel and pass ur posting.

Former Member
0 Kudos

How can we write select statement at receiver jdbc adapter?

Thanks & Regards,

Purushotham

Former Member
0 Kudos

Hi,

There are two ways you can achieve this.

1. Instead of directly calling SQL statements write a stored procedure on database which will have first select query and then based on its result fire the insert query.For processing any logic like this stored procedure is the best approach. You can call SP from your jdbc receiver channel

2. By using a BPM. In this case you have to first fire a select query in the database and based on the response from database, fire the insert statement from bpm only. basically you will be having 2 send steps to database. One with Select statement and another with insert statement. You need to handle your logic in BPOM in this case.

Hope this answers your question.

Thanks

Amit

Former Member
0 Kudos

I have resolved myself

Former Member
0 Kudos

let's know how did u resolve? did u create Stored Procedure?

Former Member
0 Kudos

No I did not create the Stored Procedure. By using BPM i have solved this

Regards,

Purushotham