Page 1 of 1

MOdify Stage: Multiple specifications for same source column

Posted: Thu Jul 19, 2007 7:45 am
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

Re: MOdify Stage: Multiple specifications for same source co

Posted: Thu Jul 19, 2007 8:04 am
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.

Posted: Thu Jul 19, 2007 9:27 am
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

Posted: Thu Jul 19, 2007 9:38 am
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

Posted: Thu Jul 19, 2007 4:32 pm
by ray.wurlod
newcolumn:nullable datatype = function[options](inputcolumn)