initial load

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
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

initial load

Post by kris007 »

Hi,

I am trying to do an initial load into Oracle table.
For this I created a hashed file with 2 fields--Timestamp and a Dummy field(as a key column). I am looking up on this hashed file with my source table and checking it against the last updated date in my source table. If source.lastupdated >= hashedfile.lastupdated, I will then extract the data. I am giving this above condition as a constraint in the Transformer. Now when i run the job to make an initial load, the data is not coming out of the Transformer though its going in. I am assuming this is because theres no value in the hashed field for the lastupdated column initially. Is there a way I can achieve this. Am I misssing out some thing. Also I would like to know if there is a better way to do it.

However, its working fine if I am doing incremental loading.

Thanks
Kris.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Consider add an OR condition to evaluate to TRUE if there is no date in the hash reference lookup. Something like:

Code: Select all

inlink.DATE_COL > ref.DATE_COL OR ISNULL(ref.DATE_COL)
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Re: initial load

Post by kwwilliams »

You could in a routine read the content of your file, your date, and pass the return value into your job. Then you could have your select statement in your source look something like this:

select columns from table where updated_datetime > #DELTADATE#

This is the technique that I prefer, but there are many ways to perform this type of work.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Kenneth..It works great. Thanks for that.
:D
vardhan354
Participant
Posts: 76
Joined: Wed Jan 25, 2006 6:42 pm

Deletes

Post by vardhan354 »

Hi,

I'm new to Datastage.I need your suggestions for implementing the logic.

Here is the situation
X is the source
Y is the target
Z is a target in a warehouse
Today the job was run X->Y-->Z
Tommorow, certain rows from X are deleted
I need to update those records in Z which are deleted in X to 'DELETE' in the Z table(Flag)(As I have to maintain the history of the source table in Z)
any suggestions wud be greatly appreciated.

Thanks.... :roll:
ETL
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi,

Please do not post duplicate posts. This post has already been answered in a different thread. You can always undo this by deleting the post.

Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Post Reply