conversion error

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
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

conversion error

Post by hargun »

hi,.


i tried to insert the column CYCLE_DAY_OF_MONTH varchar(2) to decimal
CYCLE_DAY_OF_MONTH(decimal(5)) however i getting error

conversion error decimal from string data may have been lost.

i have search a lot of forums and then tried with function

Code: Select all

StringToDecimal(select_stats.CYCLE_DAY_OF_MONTH[5,0],"ceil")
but still same error coming.

the data from source coming as 01,03 etc.

Please help me on this.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry but what are you attempting to do with the substring operators? The "[5,0]" part... remove it. Don't see any need for the "ceil" rounding either. What happens with a straight-up function call?

Code: Select all

StringToDecimal(select_stats.CYCLE_DAY_OF_MONTH)
-craig

"You can never have too many knives" -- Logan Nine Fingers
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

Post by hargun »

i use the following function as suggested

Code: Select all

StringToDecimal(select_stats.CYCLE_DAY_OF_MONTH)
Still the same error is coming( Conversion error calling conversion routine decimal_from_string data may have been lost)
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

Post by hargun »

Can somebody help me on thi.s
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Probably. Be patient...

Also verify your data types and sizes, source to target. I for one do not expect that kind of warning going from a small field to a larger one, it is generally the other way round that causes issues.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bicap
Premium Member
Premium Member
Posts: 95
Joined: Mon May 03, 2010 10:22 pm
Location: India
Contact:

Post by bicap »

Hi,

Can you give few values of input data and required out put?

Thanks,
Phani
Post Reply