on 03-29-2010 10:23 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Michael and Arman, I used the MAP object as Michael indicated and It works perfect.!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
+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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.