日期:2014-05-17  浏览次数:20565 次

Derived Column中空值判断
表中有一varchar(10)字段A,导入数据时要对该字段进行判断,如果是""的话就要转换成NULL,在Derived Column Transformation Editor中expression是这样写的 
LEN(A)== 0 ? NULL(DT_STR,10,1252) : A,
老是提示错误has a DT_STR operand that is not an input column or the result of a cast, and cannot be used with the conditional operation.  

但是expression写成这样就没问题LEN(A)== 0 ? "" : A, 直接这样也不报错NULL(DT_STR,10,1252),就是LEN(A)== 0 ? NULL(DT_STR,10,1252) : A有错,这是为什么?
------解决方案--------------------
A能转换到dt_str吗?
------解决方案--------------------
引用:
A能转换到dt_str吗?

+