null handling in transformer/join stages

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dnat
Participant
Posts: 200
Joined: Thu Sep 06, 2007 2:06 am

null handling in transformer/join stages

Post 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.
mgendy
Premium Member
Premium Member
Posts: 44
Joined: Thu Sep 10, 2009 5:30 am
Contact:

Post 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
Mohmmed Elgendy
Senior System Analyst
Data IntegrationTeam
Etisalat Egypt
+20 1118511161
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.)
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