Number as integer

Hi All,

I am using oracle db12.1 version, oracle client is 11.2 and toad 12.1 version.

I tried to desc table and one of the table column data_type is showing as INTEGER and in dba_tab_columns the data_type as NUMBER for the same column. This is strange and need some help.

Thanks
Raja

That column has a precision that makes it not store decimal values, so we use INTEGER to convey this.

Hi J,

How come my other columns are showing correctly as NUMBER when I describe and only one column is showing as INTEGER.

The INTEGER datatype has precision=NULL and data_scale=0 in DBA_TAB_COLUMNS. There may be ways to achieve the that using the NUMBER keyword, but it is the same thing if you say INTEGER in this situation (and it is easier for people to understand the datatype)

try this:

create table XX
(col1 number,
col2 integer,
col3 number(4,0));

then look in the data dictionary, then look in schema browser and see what Toad gives you back.

select column_name, data_type, data_length, data_precision, data_scale
from user_tab_columns
where table_name = ‘XX’;