Oracle and Integer types

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.  In Oracle, SMALLINT is mapped to Number and INT is mapped to INT.  Both Number and INT are the same as Number(38) in Oracle I think.  This ends up making a SmallInt and a Int bigger than the BIGINT which is Number(19,0).  Is there a generic way to specify a SmallInt when creating columns that will come out to a SmallInt on each DB?

Thanks,
Alana

Thanks for pointing that out.  I committed a fix to trunk for 2.0 that changes the type mappings for oracle.  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

Nathan

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

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.

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.

Nathan