Page 1 of 1

initial load

Posted: Wed Mar 08, 2006 7:55 am
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.

Posted: Wed Mar 08, 2006 8:17 am
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)

Re: initial load

Posted: Wed Mar 08, 2006 8:19 am
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.

Posted: Wed Mar 08, 2006 8:38 am
by kris007
Kenneth..It works great. Thanks for that.
:D

Deletes

Posted: Thu Mar 09, 2006 4:07 pm
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:

Posted: Thu Mar 09, 2006 4:32 pm
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.