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!

how to populate new rows using update strategy with a sequence key ?

Status
Not open for further replies.

vikind

MIS
Dec 11, 2003
58
US
Hi,

I have two tables Customer and Company.

Customer
--------
ID, Name, CUST_CHK


Company
-------
CUST_CHK, STATUS_IND, CUST_KEY etc..


i want to do a lookup for CUST_CHK key exists in the Company table. IF the row exists then it shud update the row with source values or else it should add a new row. and for each new row the CUST_KEY should be populated using a sequence genereator.

thanks in advance for your help






 
Split the mapping after the lookup and flag for either insert or update using two filters. Use 2 update strategies (1 for inserts, 1 for updates) and use strategy expressions DD_INSERT and DD_UPDATE respectively)

After the DD_INSERT transformation use a sequence generator (that does not reset) to write to the target.

I doubt however that it is good practice to use key-generator keys for essential fields like customer-key.
Key-generator keys have no meaning, they are just there for primary-key creation......

T. Blom
Information analyst
tbl@shimano-eu.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top