If I am using IsValid or NUM functions for cheking Integers it does not allowing NULL values,please help.
Thanks
Not accepting NULLS while using IsValid or NUM functions
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Regard all Transformer stage functions as intolerant of null.
Please be specific about what you tried and what you mean by "doesn't work" (including any error message).
The approach that was suggested will work, provided that the Else clause is complete. You don't need SetNull() in the Then clause; the result when the source is null will depend on your particular business rules.
Please be specific about what you tried and what you mean by "doesn't work" (including any error message).
The approach that was suggested will work, provided that the Else clause is complete. You don't need SetNull() in the Then clause; the result when the source is null will depend on your particular business rules.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Ray,ray.wurlod wrote:Regard all Transformer stage functions as intolerant of null.
Please be specific about what you tried and what you mean by "doesn't work" (including any error message).
The approach that was su ...
My source is varchar with null values(example: 1234,NULL,4321,NULL)
Target is integer ..
if I use IsValid or NUM function transformer .I am getting only two values like 1234 and 4321..its ignoring NULL,NULL
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What if you use something like the following for an int8 result?
Code: Select all
If IsNull(InLink.TheString) Then -1 Else IsValid(InLink.TheString, "int32")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Its created NULL value as '-1' and actual values all Zero'sray.wurlod wrote:What if you use something like the following for an int8 result?...Code: Select all
If IsNull(InLink.TheString) Then -1 Else IsValid(InLink.TheString, "int32")
0
-1
0
-1
0
-1
0
0
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Well, some progress has been made. Now you have to work out why the IsValid() function is reporting your "numeric" data not to be valid as 32-bit integers. Look for non-printing characters in the date. Try the IsValid() function with "uint32" as its second argument.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.