DB Number Columns (no scale/precision) give warnings

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
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

DB Number Columns (no scale/precision) give warnings

Post by roy »

Hi All,

I have a situation where DB tables have some numeric columns defined as number , with no sacle/precision defined.
DS imports their definition as decimal(38,10) due to lack of info, which causes some problems like:
writing an 7 digit number to a data set gives a decimal(38,10) number with leading and trailing zeros to the full 38 and 10 scale/percision mentioned (...000000012345678.00000...).
warnings for conversions and disk space and more.

I'm interested in work arounds for cases I can't redefine the columns with proper scale,precision and still get a proper number x digit integer number.

I'm gathering ideas and was wondering of what you might use or can think of for this case.

Thanks in advance,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Roy,

Are you using Oracle as DB? With oracle the columns that are defined as Number are by default getting imported as Decimal(38,10). We use the DecimalToDecimal function avialable in Transformer to reduce the size as well as the precision.

HTH
Rich
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

From memory, you can also adjust precision and scale with a Modify stage. Just specify the correct values on input and output links, and supply the appropriate function if automatic casting is not possible (which you can determine from the manual).
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