Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

integer Vs Number / role-owner

Status
Not open for further replies.

naushi

ISP
Jan 18, 2002
89
US
1) Is it true that using an INTEGER datatype (for data that will not have any decimals) is better from performance standpoint than using a NUMBER datatype.

2) How do you tell who created a user role. There is no coulmn such as role owner in any dictionary table. Regards,
Naushi Hussain
Naushi.hussain@honeywell.com
 
In fact it's supposed that PLS_INTEGER is the fastest, because it uses native arithmetic. Regards, Dima
 
But it's only usable in PL/SQL. You can't define a column with datatype INTEGER; only NUMBER.
 
No, Carp, you CAN create INTEGER column, but not PLS_INTEGER or BINARY_INTEGER. Regards, Dima
 
Boy, the things you learn! Thank-you for eliminating this ignorance!!
 
Interestingly, Oracle is still using the NUMBER datatype for INTEGER:

create table x(y integer, z number);

select dump(y), dump(z) from x;

Typ=2 Len=2: 193,24
Typ=2 Len=3: 193,24,21

09:56:54 SQL> desc x;
Name Null? Type
-------------------------- -------- -------------
Y NUMBER(38)
Z NUMBER

So it appears that under the hood, Oracle automatically truncates numbers if the column datatype is INTEGER and then stores them as numbers.

Thanks again for the quick lesson!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top