Page 1 of 1

null handling in transformer/join stages

Posted: Thu Dec 24, 2009 2:53 am
by dnat
Hi,

I have a job where i read the records from dataset, sort using sort stage, join with a table, then add some extra columns in a transformer and insert the records in the target Oracle table.


Even if there are null values in the input columns, i just pass it as it is to the output table.

do i need to do any null handling before inserting..i see in some of the existing jobs that they have done something like If isnull(col) then setnull else col.

but i dont see a need of it..i dont see any reject records because of null values in some of the columns, but want to check if it is a best practice to do that.

Posted: Thu Dec 24, 2009 3:53 am
by mgendy
i also don't think that you need to fo this check which say if something is null , then set it to null ,,, i don't think that this thing is meaningfull

Posted: Thu Dec 24, 2009 8:58 am
by chulett
If your output column is nullable and you're fine with them, then there's no need for null handling. Do it when your target does not allows null - even if there will 'never be any' - just to shut PX up. :wink:

Posted: Thu Dec 24, 2009 3:31 pm
by ray.wurlod
You will, however, need to prevent functions in the Transformer stage from receiving NULL as an argument.

Code: Select all

If IsNull(inlink.fieldname) Then SetNull() Else function(inlink.fieldname)
(Relaxing this restriction is on the road map, maybe even in the next version of Information Server.)