Page 1 of 1

Job aborts - Alpha function

Posted: Fri Jun 13, 2008 3:47 am
by wfis
Hi All,


I have used the Alpha function and handled NULL but it yet does not work and gives warning

If Trim(Lnk_Read_ds.NAME_LINE)='' Or IsNull(Lnk_Read_ds.NAME_LINE) Then 0 Else If Alpha(Trim(Trim(Trim(Lnk_Read_ds.NAME_LINE),'-','A'),' ','A')[2,39]) Then 1 Else 0

Error is "Null String Argument"

Any help

Thanks

Posted: Fri Jun 13, 2008 4:40 am
by ameyvaidya
I think the problem is to do with:

Code: Select all

Trim(Lnk_Read_ds.NAME_LINE)=''
Trim will not take kindly to a null value as input

try this:

Code: Select all

If Trim(NullToEmpty(Lnk_Read_ds.NAME_LINE))='' Then 0 Else If Alpha(Trim(Trim(Trim(Lnk_Read_ds.NAME_LINE),'-','A'),' ','A')[2,39]) Then 1 Else 0 

Posted: Fri Jun 13, 2008 5:16 am
by wfis
Thanks its working now.