Nullable Key Column

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Nullable Key Column

Post by harshada »

Can a key column be nullable (nullable =yes). In one of the jobs I can see this. More than one columns are key columns and out of those all are nullable =No, except one column, still the job is running fine.

Want to understand how this is working.
Also, can we apply a if 'isnull' function on the key column where
nullable =yes as well as key column where nullable = no
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Yes, key columns can be nullable. NULLs are effectively another value for a column and you're still bound to any unique constraints that are in effect for your data source/target.

Null-handling logic in the modify and transformer stages is meant to be applied only to nullable columns. You will receive warnings if you try to use IsNull() on a non-nullable column.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

Thanks.

I expected the same. But now the job is aborting with error

Using "null" conversion with non-nullable input
APT_CombinedOperatorController(0),0: Null handling function called on a not nullable field.

for the only column which is key and nullable is Yes and not for the rest of the key columns which are already nullable=no. This is strange.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just get it right. If the data can contain nulls, mark them as nullable and handle the nulls. If the data can not contain nulls, do neither of these things.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply