Page 1 of 1

IsNull() in transformer...

Posted: Thu Sep 30, 2010 5:50 pm
by allavivek
Hi All,,


For one field from input file iam getting null values , length is 0....

i was trying to load in oracle dtabase....all records are getting dropped and sql code is -1400...i know its due to null values issue...

the equation i used in transformer is

if IsNull(DSLink150.xxxx) then '9' else DSLink150.xxxxxx


but i was getting empty values and records are getting dropped resulting in sql code -1400....

Any suggestions...

Posted: Thu Sep 30, 2010 6:06 pm
by chulett
In Oracle, an empty string is converted to a null... they are equivalent. And an empty string would test 'true' as a null, so test for both.

Posted: Thu Sep 30, 2010 6:29 pm
by allavivek
chulett wrote:In Oracle, an empty string is converted to a null... they are equivalent. And an empty string would test 'true' as a null, so test for both. ...

chulett i didnt get you..

so you are telling that in oracle null and empty string (both are having length 0) are same...

thanks...

Posted: Thu Sep 30, 2010 6:38 pm
by anbu
Chulett was mentioning about testing your input for empty string

Code: Select all

if IsNull(DSLink150.xxxx) And Trim(DSLink150.xxxx) = '' then '9' else DSLink150.xxxxxx 

Posted: Thu Sep 30, 2010 7:00 pm
by allavivek
anbu wrote:Chulett was mentioning about testing your input for empty string

Code: Select all

if IsNull(DSLink150.xxxx) And Trim(DSLink150.xxxx) = '' then '9' else DSLink150.xxxxxx 

i anbu thanks it worked but placed OR in place of AND...

Posted: Thu Sep 30, 2010 8:16 pm
by chulett
allavivek wrote:so you are telling that in oracle null and empty string (both are having length 0) are same...
I was saying that Oracle considers them equivalent, converting one to the other - DataStage does not, however.