Home » SQL & PL/SQL » SQL & PL/SQL » datatypes question (10.2.0.1, Windows 2003)
datatypes question [message #353706] |
Tue, 14 October 2008 15:09  |
sant_new
Messages: 165 Registered: June 2008
|
Senior Member |
|
|
Hi all, I work with both Oracle and SQl server databases. There is a similar table in both databases and we have number(15) datatype for a column in Oracle and bigint in SQL server.
In SQl server below are the details I found:
Bigint holds data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807).
Smallint holds data from -2^15 (-32,768) through 2^15 - 1 (32,767).
Int holds data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).
In Oracle, I think number(38) datatype basically holds 38 digits. If anyone here know the equivalent of bigint,smallint and int in Oracle, please help me.
Thank you so much!
|
|
|
Re: datatypes question [message #353723 is a reply to message #353706] |
Tue, 14 October 2008 19:28  |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
This should be adequate reference
http://www.ss64.com/orasyntax/datatypes.html
else see
http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/datatype.htm
CREATE TABLE num_test(
col1 INT,
col2 INTEGER,
col3 DECIMAL,
col4 FLOAT,
col5 NUMBER,
col6 NUMBER(38),
col7 NUMBER(20,6));
SQL> select TABLE_NAME, COLUMN_NAME, DATA_TYPE,
2 DATA_LENGTH, DATA_PRECISION, DATA_SCALE
3 from user_tab_columns where table_name = 'NUM_TEST';
TABLE_NAME COLUMN DATA_TYPE DATA_LENGTH DATA_PRECISION DATA_SCALE
---------- ------ ---------- ----------- -------------- ----------
NUM_TEST COL1 NUMBER 22 0
NUM_TEST COL2 NUMBER 22 0
NUM_TEST COL3 NUMBER 22 0
NUM_TEST COL4 FLOAT 22 126
NUM_TEST COL5 NUMBER 22
NUM_TEST COL6 NUMBER 22 38 0
NUM_TEST COL7 NUMBER 22 20 6
7 rows selected.
SQL>
[Updated on: Tue, 14 October 2008 19:41] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Feb 06 14:31:56 CST 2025
|