Insert/Update Table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

Insert/Update Table

Post by reddy »

Hello Sirs,

I have master customer file and 4 ODBC Dataware house tables like cust_address,country,region,geography tables.

I have to Insert all records into cust_address table where no customer key and customer addrtype = 's' not found in cust_address table when matched with master customer file using custno key field.

I have to update cust_address table when current record is differ from existing master record based on fields
geography key,address1,address2,postal code,phone number...

Can you suggest me how to create the job.

Thanks
Narasa
kris
Participant
Posts: 160
Joined: Tue Dec 09, 2003 2:45 pm
Location: virginia, usa

Re: Insert/Update Table

Post by kris »

Here is my aproach to this:

1. Create a table Master_Customer and load with your master file only key fields or necessary fields.

2. your job should look like:

Code: Select all


Join tables in (plugin stage)
Master_Customer ------------> Hash File
cust_address                |
and necessary tables   	  |
                             -----Insert---->
Master file   --------Transformer      cust_address(plug-in stage)
                             -----Update--->
3. Hash file should have all the necessary key fields that you should be checking to decide whether it is insert or update.
4. Give proper constraints for insert update links.

Kris~



[/code]
SriKara
Premium Member
Premium Member
Posts: 30
Joined: Wed Jun 01, 2005 8:40 am
Location: UK

Post by SriKara »

Yes i agree with kris.
Loading the keys of the master customer file into a table in the staging area..
and then doing the join between staging table and target tables to create the hash file, to figure out I / U is an efficient way of loading the dimensions of a star schema.
Post Reply