# Oracle and Integer types

**URL:** <https://forum.liquibase.org/t/oracle-and-integer-types/265>\
**Category:** General Discussion\
**Created:** [September 24, 2009, 9:13pm UTC](https://forum.liquibase.org/t/oracle-and-integer-types/265 "2009-09-24T21:13:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alana\_cable](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@alana\_cable](https://forum.liquibase.org/u/alana_cable)\
**Post date:** [September 24, 2009, 9:13pm UTC](https://forum.liquibase.org/t/oracle-and-integer-types/265/1 "2009-09-24T21:13:00Z")

</div>

Hi,

SmallInts and Integers are not coming out in Oracle as I would think?

Lets say I have:

```

```

On MySQL, MSSQL, etc, the column types are what I would expect.&nbsp; In Oracle, SMALLINT is mapped to Number and INT is mapped to INT.&nbsp; Both Number and INT are the same as Number(38) in Oracle I think.&nbsp; This ends up making a SmallInt and a Int bigger than the BIGINT which is Number(19,0).&nbsp; Is there a generic way to specify a SmallInt when creating columns that will come out to a SmallInt on each DB?

Thanks,  
Alana

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [September 24, 2009, 9:13pm UTC](https://forum.liquibase.org/t/oracle-and-integer-types/265/2 "2009-09-24T21:13:00Z")

</div>

Thanks for pointing that out.&nbsp; I committed a fix to trunk for 2.0 that changes the type mappings for oracle.&nbsp; We now use:

bigint: NUMBER(38,0)  
int: NUMBER(10,0)  
tinyint:NUMBER(3)

double: FLOAT(24)

I took the list from [http://download.oracle.com/docs/cd/E12151\_01/doc.150/e12155/oracle\_mysql\_compared.htm](http://download.oracle.com/docs/cd/E12151_01/doc.150/e12155/oracle_mysql_compared.htm)

Nathan

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [September 24, 2009, 9:13pm UTC](https://forum.liquibase.org/t/oracle-and-integer-types/265/3 "2009-09-24T21:13:00Z")

</div>

Hi, the last post is a long time ago. But what about the smallint data type? It is still a NUMBER(38,0) in oracle. If I follow the link above, then it should be NUMBER(5,0). Is it planned to add this too?  
thanks, Oliver

---

<div class="post-metadata">

**Author:** ![gerjerts](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@gerjerts](https://forum.liquibase.org/u/gerjerts)\
**Post date:** [September 24, 2009, 9:13pm UTC](https://forum.liquibase.org/t/oracle-and-integer-types/265/4 "2009-09-24T21:13:00Z")

</div>

Is there a JIRA for this fix?  
  
My testing (w/ 2.0.5) still shows that java.sql.Types.INTEGER (or INT) results in a NUMBER(38,0). If it makes a difference, my testing was with modifying the data type (modifyDataType) rather than creating a column.

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [September 24, 2009, 9:13pm UTC](https://forum.liquibase.org/t/oracle-and-integer-types/265/5 "2009-09-24T21:13:00Z")

</div>

I use version 3.0.6 and notice that for Oracle the INTEGER, SMALLINT and BIGINT all create a NUMBER(38,0) in Oracle.

Apparently the code change noticed earlier in this thread never made it into any final release.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [September 24, 2009, 9:13pm UTC](https://forum.liquibase.org/t/oracle-and-integer-types/265/6 "2009-09-24T21:13:00Z")

</div>

Nathan
