Page 1 of 1

Null Value in Stage variable and related fatal error

Posted: Mon Jun 07, 2010 9:15 am
by RAJARP
Hi all.


Intially i had one expression for a stage variable

Code: Select all

 if  TrimIndicator ='A' and ValidZip='ZIPVALID' and ValidMail='MAILVALID' and ValidSmail='SMAILVALID'
     
     then
     'VALID'
     else
'REJECT'

I got one fatal error 'Null value on the accessor interfacing to field "INDICATOR".'

Note :where TrimIndicator is a stage variable with expression 'Trim(NullToEmpty(transformer_link.INDICATOR))'

and it has null values too.




so i modified the expression as follows

Code: Select all

 if TrimIndicator='' then
 'REJECT'
 
 else
 
 (if ValidZip='ZIPVALID' and ValidMail='MAILVALID' and ValidSmail='SMAILVALID' 
 
 then 
 'VALID'
 else
'REJECT')
and i did not got any error.

so i want to know what went wrong in the first case. Your help would be highly appreciated

Regards,
Raja R P

Posted: Mon Jun 07, 2010 10:53 am
by asorrell
The only way to get that error message is to do a test or a function (other than the "Null" type functions) on a field that contains a null value.

For instance in your original code where you say " if TrimIndicator ='A'", if you had not put the NulltoEmpty conversion in place prior to that test - you'd have the problem.

Posted: Mon Jun 07, 2010 12:47 pm
by RAJARP
hi asorell,
Thanks for your time.In my code, before using " if TrimIndicator ='A' " i had put the NulltoEmpty conversion .Even then i got that fatal error.

Thanks,
Raja R P

Posted: Mon Jun 07, 2010 12:54 pm
by Sreedhar
Before I can answer you question I would like to know the source of your data.

Posted: Mon Jun 07, 2010 12:58 pm
by mkkgupta
modify your Stg Var. by using if then else.

if Isnull(Input) then some value else trim(input)
then reject based on value given in Stg var.

Posted: Tue Jun 08, 2010 10:41 am
by RAJARP
sreedhar,
my data source is an oracle table.

Thanks,
Raja R P