String to Number Convertion ( User defined SQL ) problem

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

kbsuryadev
Premium Member
Premium Member
Posts: 46
Joined: Wed Jun 06, 2007 10:32 am

Post by kbsuryadev »

source ACD_ID( NULL) TARGET ACD_ID( NULL)

In datastage it should say YES on both source and target ................. not NO
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

As a workaround, try wrap your query within another select query i.e.

Code: Select all

select col1, col2, colasnum from
( select col1, col2, to_number(col3) as colasnum....)
Not sure why but DataStage EE doesn't seem to like conversions within queries... [/code]
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

sreddy wrote:Thank you Priyadarshi Kunal

I need data in Number that is why i am converting from String to Number.

please follow the history messages and help me.

"ACT_ID" to field "ACT_ID": Implicit conversion from source type "decimal[38,10]" to result type "string[12]": Not enough room in string for decimal[38,10].

this error means that you have defined the coulmn as varchar(12)

and you are applying to_number() in your query. when you don't specify the length of number explicitly it will be taken as number(38,10). Thats why you are getting this error.

Please try to understand the post before replying.

Regards,
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

There is also a theoritical possiblity of getting a null value even if the column is not null when you apply any conversion function and hence the warning related to null. You need to define it as null and then convert it to not null in downstream modify/transformer stage.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
kbsuryadev
Premium Member
Premium Member
Posts: 46
Joined: Wed Jun 06, 2007 10:32 am

Post by kbsuryadev »

thanks Kunal ....I am glad you found the solution.
Post Reply