Page 1 of 1

behaviour of NULLTOZERO against primarykey field

Posted: Tue Aug 19, 2008 11:01 pm
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?

Posted: Wed Aug 20, 2008 1:17 am
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.

Posted: Wed Aug 20, 2008 1:30 am
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

Posted: Wed Aug 20, 2008 2:23 am
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.

Posted: Wed Aug 20, 2008 7:01 am
by chulett
What was the resolution? :?

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