behaviour of NULLTOZERO against primarykey field

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
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

behaviour of NULLTOZERO against primarykey field

Post by pxraja »

Hi all,

I had unusual behaviour when I used NULLTOZERO against the composite primary key, obiviously primary key field will not be NULL. But unfortunately I tested this function, it's returning only zero value, its not taking the value in that field.

for example

below are the four fields, in that Inlink.field1 Inlink.field2 are primary key fields

Inlink.field1 Inlink.field2 Inlink.field3 Inlink.field4
25488 0 like fruit
25488 2543 nike veg

expected result is

Outlink.field1 Outlink.field2 Outlink.field3 Outlink.field4
25488 0 like fruit
25488 2543 nike veg

But the result obtained is

Outlink.field1 Outlink.field2 Outlink.field3 Outlink.field4
25488 0 like fruit

when I removed that Nulltozero on Inlink.field2 I am getting two records in the oracle database

Outlink.field1 Outlink.field2 Outlink.field3 Outlink.field4
25488 0 like fruit
25488 2543 nike veg

I want to know this behaviour of NULLTOZERO against the primary key has anyone faced this type of problem?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Which NULLTOZERO is this?

The supplied Transform is called NullToZero (and it's case sensitive).

If you have your own NULLTOZERO routine/transform, I'd suggest you test it more thoroughly.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

Hi ray

No it's from the DS Transform

NullToZero(%Arg1%) only I had used,

If I am not knowing about what its doing against primary key field? how reliable will my data as i had populated with it already?

so I need to clarify about its behaviour

Thanks for your reply
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Transform is entirely agnostic about whether or not the value on which it is operating is a primary key or not. If the argument is null, then 0 is output. If the argument is not null, then the argument is output. End of story.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What was the resolution? :?

Your problem has nothing to do with the NullToZero transform, btw.
-craig

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