MOdify Stage: Multiple specifications for same source column

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
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

MOdify Stage: Multiple specifications for same source column

Post by jreddy »

Can we have multiple specifications for same source column in the Modify Stage? coz i tried that and i get the error message that it was already 'bound'

I have a requirement where the source column is nullable and i need to change its nullability via this modify stage, but i also need to change datatype..do i need 2 modify stages or can i do 2 specifications for this column in one stage..?

pls advise
JeroenDmt
Premium Member
Premium Member
Posts: 107
Joined: Wed Oct 26, 2005 7:36 am

Re: MOdify Stage: Multiple specifications for same source co

Post by JeroenDmt »

jreddy wrote:Can we have multiple specifications for same source column in the Modify Stage? coz i tried that and i get the error message that it was already 'bound'

I have a requirement where the source column is nullable and i need to change its nullability via this modify stage, but i also need to change datatype..do i need 2 modify stages or can i do 2 specifications for this column in one stage..?

pls advise
You can only have one specification for a source column.

However you can do both the modifications that you want in the same specification.
You can make a specification like

Code: Select all

  new_field:nullable string[max=10] = conversion_of_old_field
That way you can both change its nullability and the datatype.
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

Thanks JeroenDmt

Here's what i needed to do - source is nullable with datatype of varchar2(8) - basically its length is defined as 8, but holds data with only 2 chars length

my target has this column defined as NOT NULL and varchar2(2)

In the modify stage, i created a new column with datatype varchar2(2) and nullability NOT NULL and i specified

<new_column_name>=handle_null(<old_column_name>,"NO")

But the warning message says
When binding input interface field "SC" to field "SC_NEW": Implicit conversion from source type "string[max=8]" to result type "string[max=2]": Possible truncation of variable length string.

How should i get rid of this warning.. thanks
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

Actually, i just tried a CAST(column_name as varchar2(2)) when reading the source and set the metadata as varchar2(2) right from the beginning and avoided the use of modify for modifying datatype.. still going to use it for modifying the nullability..

this workaround worked for me, but i'd like to know (if you have time) if i can still use Modify to do both nullability and datatype modification, as in my case... thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

newcolumn:nullable datatype = function[options](inputcolumn)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply