cancel
Showing results for 
Search instead for 
Did you mean: 

Delete records on target table - Which method?

Former Member
0 Kudos

Hi ,

Im trying to figure out how to delete records on target table.

I Have a Query transform with the Key IDs to be deleted on the target table, which is the best way to do this?

Im trying to avoid to execute a SQL string agains the DB..but not sure which platform object is the most recommended.

Thanks in advance, Pablo.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

This can be tricky at first.

If you have the IDs of the rows to delete, you can use the map operation (set normal to delete) and then the target table.

Make sure you set the ID columns to be Primary Key (even though they might not be) and have to Use Input keys on the target table if the ID are not the table's primary key. This is so the where clause is generated correctly.

If you want to check the delete SQL that's being executed at runtime, set the table loader SQL trace option from the job execution options.

Michael

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Michael and Arman, I used the MAP object as Michael indicated and It works perfect.!

Former Member
0 Kudos

+1

Map operation would be a good solution.

Otherwise I think you have to use SQL() function. Maybe write a function and call it. The input would be the field to be deleted.