Not writing to column: NVL

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
coface
Premium Member
Premium Member
Posts: 57
Joined: Fri Aug 10, 2007 8:13 am

Not writing to column: NVL

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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 ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
coface
Premium Member
Premium Member
Posts: 57
Joined: Fri Aug 10, 2007 8:13 am

Post 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
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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 
coface
Premium Member
Premium Member
Posts: 57
Joined: Fri Aug 10, 2007 8:13 am

Post 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 :?:
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Have you ticked on/off the nullable property in source?
coface
Premium Member
Premium Member
Posts: 57
Joined: Fri Aug 10, 2007 8:13 am

Post 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
Post Reply