how to convert Nvarchar to Numeric

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
srao
Premium Member
Premium Member
Posts: 41
Joined: Mon Mar 19, 2007 12:42 pm

how to convert Nvarchar to Numeric

Post by srao »

how to convert Nvarchar to Numeric value
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

In server there are no datatypes internally, they are all stored as characters. So if you mean you want to extract numbers from an alphanumeric string then you can use OCONV with MCN conversion code. If you mean something else then please explain.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If the VarChar contains a valid number, perform some arithmetic, such as adding zero to it.

Code: Select all

If Num(InLink.TheString) Then InLink.TheString + 0 Else InLink.TheString
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