Page 1 of 1

Converting Null into Not Null Using Modify Stage

Posted: Sun Nov 04, 2007 11:53 pm
by tech_savvy
I want to convert Null to Not Null of a column with data Type as Date. I am using Reprt_Date : string = NullToValue (Reprt_Date,"Null") in the Specification of Modify stage. But I am getting error as
"main_program: Error parsing modify adapter: Error in binding: Unknown conversion: NullToValue
Expected destination field selector, got: ")"; input:
Reprt_Date : string = NullToValue (Reprt_Date,"Null")
;
Error parsing modify adapter: Error in binding: Unknown conversion: NullToValue
Expected destination field selector, got: ")"; input:
Reprt_Date : string = NullToValue (Reprt_Date,"Null")
;"

Thanks In advance

Posted: Mon Nov 05, 2007 12:21 am
by balajisr
You should be using handle_null() instead of NullToValue which is a transformer function.

Posted: Mon Nov 05, 2007 12:24 am
by Scope
Hai,

Use this format

destField[:dataType] = handle_null (sourceField,value).

Reprt_Date :string = handule_null (Reprt_Date,"Null")

Modify Stage Has Seperate Orchestrate Functions.we can;tTransformations Stage functions in modify stage.

Posted: Mon Nov 05, 2007 12:24 am
by Scope
Hai,

Use below mentioned format ;

destField[:dataType] = handle_null (sourceField,value).

Reprt_Date :string = handule_null (Reprt_Date,"Null")

Modify Stage Has Seperate Orchestrate Functions.we can't use Transformations Stage functions in the modify stage.

The data type is Date

Posted: Mon Nov 05, 2007 12:37 am
by tech_savvy
when i am giving the above said Condition for Datatype Date, the error I am getting is
Modify_112: Error when checking operator: When binding output schema variable "outRec": When binding output interface field "Reprt_Date" to field "Reprt_Date": Bad literal for type date: Null.

Thanks in Advance

Posted: Mon Nov 05, 2007 12:42 am
by balajisr
"Null" is not a valid date value.

Your business rules has to decide what should be the default date when the input date is null. E.g 1500-01-01.

Reprt_Date : string = NullToValue (Reprt_Date,"Null")
What is Reprt_Date datatype when output? The above answer is applicable only if it is date.

Your specification should be:

Code: Select all

Reprt_Date :date = handle_null(Reprt_Date,"1500-01-01")