Database

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

03-26-2017
10:20 PM

03-26-2017
10:20 PM

Hi All

We have a requirement where one field can have value between exp(-40) to exp(40) range.

We need a data type which can hold both values to their actual precision whithout any change/modification.

I tried using NUMBER(38,32) but that is working only for exp(-40)

Also, I tried using NUMBER(38,8) but that is working only for exp(40)

Need help to find only one common data type for both, please advise.

Thanking You

Santanu Ghosh

Solved! Go to Solution.

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

03-27-2017
12:33 AM

03-27-2017
12:33 AM

There's no datatype in Teradata which can store 40 digits of precision.

If you want to store a huge range of values you simply define NUMBER without precision, i.e. NUMBER or NUMBER(*) then it acts like a kind of super-float with 38 digits of precision.

1 ACCEPTED SOLUTION

5 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

03-27-2017
12:01 AM

03-27-2017
12:01 AM

Re: Teradata Data Type for exp+40 and exp-40 data

check the manual on the difference between Numeric and Decimal.

Try Decimal(38,20)

Ulrich

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

03-27-2017
12:33 AM

03-27-2017
12:33 AM

There's no datatype in Teradata which can store 40 digits of precision.

If you want to store a huge range of values you simply define NUMBER without precision, i.e. NUMBER or NUMBER(*) then it acts like a kind of super-float with 38 digits of precision.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

03-27-2017
01:07 AM

03-27-2017
01:07 AM

Re: Teradata Data Type for exp+40 and exp-40 data

OK - might be worth to clarfiy

My answer was interpreting the request to store the result of the exponatial funktion exp(40) and exp(-40).

exp(40) is 235385266837019985 and requires 18 digists.

exp(-40) is 1/235385266837019985

as the result of the exp funtion is a Real number neither Numeric nor Decimal can store all exp results between exp(-40) and exp(40) in full precission...But decimal(38,20) seems to work with the decimal limitations.

If the question is related to general 40 digits Dieters comment is clearly valid!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

04-02-2017
10:51 PM

04-02-2017
10:51 PM

Re: Teradata Data Type for exp+40 and exp-40 data

Thanks for your reply, I really appreciate that.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

04-02-2017
10:51 PM

04-02-2017
10:51 PM

Re: Teradata Data Type for exp+40 and exp-40 data

Thanks for your reply, I really appreciate that.