nullable fields in hash file and oraoci stages

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
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

nullable fields in hash file and oraoci stages

Post by kollurianu »

Hi All,

I have three fields in my odbc lookup stage that is (composite key)

f1, f2, f3, can i have null values in f2 and f3 fields still use it for lookup.


similarly can have nullable field as key field in the hash field,

thank you all for your answers in advance.
sivatallapaneni
Participant
Posts: 53
Joined: Wed Nov 05, 2003 8:36 am

Post by sivatallapaneni »

I dont think you can have null fields as key in a hash file. At least the hash file wouldn't allow the null key fields.

I'm not sure about ODBC lookup. My guess is it is ok to have.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, it's not ok.

A lookup is an equi-join where field = key and what is equal to null? Yup, that's right - nothing. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
dzdiver
Participant
Posts: 36
Joined: Tue May 25, 2004 8:55 am
Location: global

Post by dzdiver »

I am using version 7.1

I have a job that selects from database and looks up a hash file with 3 key columns plus a lookup column.

The hash file was built from a database select and in some rows, one of the key column values were null.

some of my select result:-
(note the last 3 values are the key cols)
4600,'G','GPRS5','IMODE'
...
4602.'G','IMDFRM','FREE IMAIL'
...
4603,'Q','IMAIL',NULL

The job itself selects from a table and matches into the hash file on three columns. Some of the rows in source data have data in all three columns and other rows have nulls in one of the columns, which matches the hash file.

The cases where all columns are populates works correctly, as do the cases where there is null in a key column, correctly matching on the other populated 2 key columns.

so with incoming data like:-
'G','GPRS5','IMODE'
'G','IMDFRM','FREE IMAIL'
'Q','IMAIL',NULL

I get out the warehouse keys
4600
4602
4603

8)

HTH,
Brian.
Post Reply