Page 1 of 1

Not writing to column: NVL

Posted: Mon Feb 23, 2009 4:15 am
by coface
Hello,

I implement a dataStage job to Extract from a Oracle Database. Source is mytable and goal goaltable
The following SQL statement is not working can somebody tell me why:

SELECT
value1, value2, value3, NVL(TRIM(CODE),'UNKNOW'), value4 FROM mytable

Error: goaltable: Not writing to column CODE, and the field does not accept nulls.
mytable: When checking operator: The modify operator has a binding for the non-existent output field " CODE ".

Thanks

Posted: Mon Feb 23, 2009 5:15 am
by ray.wurlod
Is CODE not nullable both on the input and on the output of the Modify stage? What is the data type of CODE ?

Posted: Mon Feb 23, 2009 5:19 am
by coface
Is CODE not nullable both on the input and on the output of the Modify stage?
Yes
What is the data type of CODE ?
VARCAHR2

Posted: Mon Feb 23, 2009 5:23 am
by Sainath.Srinivasan
What if you provide an alias name in source.

like

Code: Select all

SELECT 
value1, value2, value3, NVL(TRIM(CODE),'UNKNOW') CODE, value4 FROM mytable 

Posted: Mon Feb 23, 2009 5:37 am
by coface
Sainath.Srinivasan wrote:What if you provide an alias name in source.

like

Code: Select all

SELECT 
value1, value2, value3, NVL(TRIM(CODE),'UNKNOW') CODE, value4 FROM mytable 
:D Oh tanks ist's working but why? I dont understand. Now i have the folowing warning:
mytable: When checking operator: When binding output interface field "CODE" to field "CODE": Converting a nullable source to a non-nullable result;
a fatal runtime error could occur; use the modify operator to
specify a value to which the null should be converted.
But in mytable and goaltable the "CODE" is not Nullable :?:

Posted: Mon Feb 23, 2009 5:43 am
by Sainath.Srinivasan
Have you ticked on/off the nullable property in source?

Posted: Mon Feb 23, 2009 7:08 am
by coface
Sainath.Srinivasan wrote:Have you ticked on/off the nullable property in source?
Yes, both on the source and the target. I will simply igore the warning. Thanks all of you