cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting Duplicate Entries in sender JDBC adapter

former_member223432
Participant
0 Kudos

Hi i am working on JDBC to IDOC scenario.

When i am fetching the records from the Oracle database table using select query, i am getting the records but its getting duplicated many a times and hence its failing at an idoc processing at ECC side..

Could someone help me in deleting the Duplicate entries and passing only the required entries from Oracle databse to IDOC.

Here is my select query.:

Select a.order_num, a.sap_delivery_number, a.sap_delivery_line_number, a.warehouse, a.product, a.product_size, a.order_qty, a.ship_qty from XXX_h a,tr_log t where a.Prod_id = 101..

Appreciate your help.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

rajasekhar_reddy14
Active Contributor
0 Kudos

What do you mean by duplicate records? is is picking old data also?? iy yes then write update statement correctly to update the Flag filed.

Regards,

Raj

former_member223432
Participant
0 Kudos

Hi RajaSekar,

Thanks for your reply.

Its not picking up the old data instead, it is repeating the same set of data multiple times.

Regards

rajasekhar_reddy14
Active Contributor
0 Kudos

1)First check in Data base table , if any duplicte records available, if yes then ask DB team to handle this in DB level.

2)If no duplicate records in DB , then check your select query , it might be wrong, execute same SQL Query stand alone and see the results. if it is giving duplicate records then correct it.

3)if Select query correct and data also correct, if you want filter records then write a mapping logic in mapping level to filter .

Regards,

Raj

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>> Its not picking up the old data instead, it is repeating the same set of data multiple times.

The below suggestion might be helpful

a) First do your select statement

b) Second , Use update statement and here set some flag in that table that these records are already queried. say boolean read = true for the above queried records.

That's it. When you query next time, you will not reread the same data. You will read the new data.

Duplicate Entries: Check with db client tool like Toad or sqlplus and see whether duplicate entries exists in the table. If so, then fix the data first.

Edited by: Baskar Gopal on Feb 22, 2011 1:02 PM

vkaushik82
Active Participant
0 Kudos

Is it Prod ID not a unique key in your table?

Also one more doubt whats a use of 2nd table in your query.