Home » SQL & PL/SQL » SQL & PL/SQL » Number & Numeric & integer what is the difference (oralce 11g)
Number & Numeric & integer what is the difference [message #607635] Mon, 10 February 2014 07:38 Go to next message
amirtharaj
Messages: 1
Registered: February 2014
Location: Madurai
Junior Member
Hi

Could you please let me know the difference between these datatypes NUMBER , NUMERIC and INT

If there is no difference then why these reduntant datatypes present in Oracle.

Thanks
Amirth
Re: Number & Numeric & integer what is the difference [message #607637 is a reply to message #607635] Mon, 10 February 2014 07:40 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Easy to reverse engineer:
orclz> create table t1(c1 number,c2 numeric,c3 int);

Table created.

orclz> desc t1;
 Name                                                              Null?    Type
 ----------------------------------------------------------------- -------- ----------
 C1                                                                         NUMBER
 C2                                                                         NUMBER(38)
 C3                                                                         NUMBER(38)

orclz>
ANSI SQL compliance might be a reason.


--update:
Sorry, I forgot to do the moderator bit -
Welcome to the forum. Please read our OraFAQ Forum Guide and please read How to use [code] tags and make your code easier to read

[Updated on: Mon, 10 February 2014 07:42]

Report message to a moderator

Re: Number & Numeric & integer what is the difference [message #607638 is a reply to message #607637] Mon, 10 February 2014 07:43 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can also look up their definition in sys.standard:
  subtype INTEGER is NUMBER(38,0);
  subtype INT is INTEGER;
  subtype SMALLINT is NUMBER(38,0);
  subtype DECIMAL is NUMBER(38,0);
  subtype NUMERIC is DECIMAL;
Re: Number & Numeric & integer what is the difference [message #607639 is a reply to message #607638] Mon, 10 February 2014 08:09 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
hi cookie,

Please i want one clarification with this question.When we are defining variables in oracle 10g etc. then we can use like :



subtype v_col1 is number;

OR

v_col1 number;



Please clarify the difference between these 2 declarations in pl/sql
Re: Number & Numeric & integer what is the difference [message #607643 is a reply to message #607639] Mon, 10 February 2014 08:51 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
A subtype is not a variable.
Re: Number & Numeric & integer what is the difference [message #607713 is a reply to message #607643] Tue, 11 February 2014 05:24 Go to previous message
msol25
Messages: 396
Registered: June 2011
Senior Member
Thanks Cookie Sir !!!
Previous Topic: Error in PL/SQL Procedure using UTL_HTTP
Next Topic: trigger when insert into select
Goto Forum:
  


Current Time: Thu Mar 28 07:35:07 CDT 2024