NUMBER data types

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
tracy
Participant
Posts: 47
Joined: Mon Aug 07, 2006 9:19 am

NUMBER data types

Post by tracy »

We generally use DataStage to move data from sources to Oracle.

In Oracle, it's my understanding that there are different NUMBER data types:
NUMBER(6) would allow six digits max. I think that may mean 6 total including decimals, so you could have 4 before the decimal and 2 after, but not more than 6 total.
NUMBER(11,2) would allow 11, but 2 are reserved for the decimal.
NUMBER is unlimited in any direction.

So I figured we should just go with NUMBER since it will accomdate anything.

However, I'm not sure what the best way to use these data types in DataStage is.

Do you recommend using Decimal? What about the length and scale values?
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

You could use 'Numeric'. Or the best would be to allow DataStage itself to figure out what the datatype would by importing the table definition from Oracle and use this metadata in your jobs.

HTH,
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use Decimal or Float depending upon the x and y values in NUMERIC(x,y). For each column it will be different and possibly same. But follow that. If you define it as integer, it will complain on the decimal point.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sometimes it just doesn't matter. I asked a similar question a couple of years ago.
tracy wrote:NUMBER(6) would allow six digits max. I think that may mean 6 total including decimals, so you could have 4 before the decimal and 2 after, but not more than 6 total.
No, not really. NUMBER(6) is syntactically identical to NUMBER(6,0) if that helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I say stick to decimal. If you want the "after decimal digits" to be preserved after a mathamatical operation, you dont have to use FMT and ICONV/OCONV functions to maintain its format.
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 »

I say stick to import. That way the table definition is untouched by human hands and least likely to contain errors.

You are, of course permitted - nay, encouraged - to type in column descriptions where these are absent.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tracy
Participant
Posts: 47
Joined: Mon Aug 07, 2006 9:19 am

Post by tracy »

Thanks for the tips. I didn't even think to use the import feature. I went ahead and did that and in case you are wondering, the NUMBER comes out to Decimal with a length of 38 and no scale. I'll stick with that.
Post Reply