Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting target rows with multiple keys

Status
Not open for further replies.

sam93

Programmer
Jul 19, 2002
65
CA
Hi,

I have a question regarding deletion of rows from a relational target. I want to mark the source rows as 'Delete' and check the 'Delete' option for the target, so that if a source row already exists in the target table, it should be deleted.

Firstly, I need to have a PK constraint defined on the target table, otherwise the delete will not work. Secondly, let's say I want to delete multiple rows in the target based on a non-key value. e.g. the key for the target table is ID which will obviously have a unique value for each row, but I want to delete all the rows where DESCRIPTION column has a value of 'NA'. This value may be used by multiple rows having different IDs. How can I tell Informatica to do this. By default, the Delete statement it creates goes like 'DELETE FROM x WHERE ID = ?'.

Thanks.
 
This may be more properly handled by using a post-SQL command (see properties of the target in the mapping, version 6 onward)

However, the delete action should work based on the PK keys you send to the target. So, if you use a filter in the mapping that only passes the 'NA' valued records you will accomplsh just the same

Ties Blom
Information analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top