Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Number data type scale (Oracle, JDBC)

Number data type scale (Oracle, JDBC)

From: Tomasz Majchrzak <tomekem_at_poczta.fm>
Date: Wed, 09 Feb 2005 16:57:22 +0100
Message-ID: <pan.2005.02.09.15.57.19.490669@poczta.fm>


Hi,

I have a table created with statement:

CREATE TABLE test (field NUMBER);

I inserted one value into it:

INSERT INTO test VALUES (4);

According to Oracle documentation:



column_name NUMBER (precision, scale)

If a precision is not specified, the column stores values as given. If no scale is specified, the scale is zero.


I checked in database dictionary - DATA_LENGTH for column is set to NULL. However when I retrieve this data from database with JDBC, getScale() method of ResultSetMetaData class returns -127 which indicates double value.

When I run the same scenario against second database (almost similar environment). everything is fine - so JDBC driver is working properly.

What is the cause of such result? Is there an initialization parameter that determines default number data type scale?

My environment: Oracle 9.2, Red Hat Linux 9 with recompiled kernel (2.4.28).

Thanks for any help,

Tomek Received on Wed Feb 09 2005 - 09:57:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US