Check for Empty 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
Vishal1982
Participant
Posts: 38
Joined: Wed Oct 01, 2008 10:30 am

Check for Empty Table

Post by Vishal1982 »

Hi All,

I have a source table and target table ,i want to transfer some records into target based on records exist in target table i.e. if target table is empty then i want to transfer all the records from source and if target table is not empty , i want to transfer the records from source which are not in target and updated records from source .

Thanks in Advance
IBM Websphere Datastage Certified Professional
RShiva
Participant
Posts: 6
Joined: Tue Dec 27, 2005 3:54 am

Re: Check for Empty Table

Post by RShiva »

Simply use update action -- update existing records and insert new records option i.e upsert load mode in target table.
Specify what stage you are using to load target table?
Shiva
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Build a hashed file reference lookup from your target and use that to drive your actions. That way you can insert new records and update any changed records and pitch everything else with the right constraints.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply