Oracle Numeric data type precision and scale

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
raoraghunandan
Charter Member
Charter Member
Posts: 19
Joined: Sun Jul 20, 2003 4:29 am

Oracle Numeric data type precision and scale

Post by raoraghunandan »

Hi All,
A column defined in Oracle9i as NUMBER gets translated as Decimal with length as 38 and scale as 0 OCI9i Stage.

I suspect that this is causing rounding up of numeric values to some extent and could be the reason for some of the mismatches when we do tests like
select sum(col1) from table
in target and source

Have anyone faced similar problems before and if so any suggestions?

Thanks,
Rao
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Always visually inspect and correct your metadata once imported. Not having the correct scale will cause DataStage to round values. It's kind of spurious, it only re-scales the data if you manipulate the column in some fashion, such as adding columns. Sorry 'bout that.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Beware that the DataStage data browser manifests the kind of behaviour that Ken described, for exactly the same reason; it's driven by the metadata definitions.
Always check with a different tool, such as sqlplus or TOAD, when you suspect that some rounding is happening; the DataStage "rounding" is often only for display purposes and it handles actual processing of the data correctly.
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