Long decimal Value is getting round-off

Database

Long decimal Value is getting round-off

Values are getting round-off while inserting long decimals in the table

Please check the example below

DROP table a_test

create table a_test(id decimal(18,0));

INSERT INTO a_test(999999000028677971 (decimal(18,0)))

sel * from a_test

 id                 

 ------------------ 

 999999000028678020 

sel type(999999000028677971)

 Type(999999000028677971.)    

 ---------------------------- 

 DECIMAL(18,0)     

Teradata Version : 14.10

Could you please suggest why this happening

Thanks,

Pradeep

Tags (1)
3 REPLIES

Re: Long decimal Value is getting round-off

Hi Pradeep,

I do not see any round off happening. Using the same terdata version (14.10.04.04).

Check if its rounding off in the sql assistant or the tool which you are using.

Here is the output when I tried the same:-

BTEQ -- Enter your SQL request or BTEQ command:

create table a_test(id decimal(18,0));

create table a_test(id decimal(18,0));

 *** Table has been created.

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your SQL request or BTEQ command:

INSERT INTO a_test(999999000028677971 (decimal(18,0)));

INSERT INTO a_test(999999000028677971 (decimal(18,0)));

 *** Insert completed. One row added.

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your SQL request or BTEQ command:

sel * from a_test;

sel * from a_test;

 *** Query completed. One row found. One column returned.

 *** Total elapsed time was 1 second.

                  id

--------------------

 999999000028677971.

Hope this helps.

Thanks,

Priya

Teradata Employee

Re: Long decimal Value is getting round-off

Re: Long decimal Value is getting round-off

Thanks Priya.....this seems to happening due to client issue