My Oracle Support Banner

JDBC ResultSetMetaData: Wrong Precision Value Returned for Column of Type Number Added by ALTER TABLE Statement (Doc ID 1266785.1)

Last updated on JUNE 05, 2023

Applies to:

JDBC - Version 11.1.0.6 to 11.2.0.1.0 [Release 11.1 to 11.2]
Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.2.0.1 [Release 11.1 to 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Information in this document applies to any platform.

Symptoms

Using JDBC ResultSetMetaData for finding the precision of a column defined as 'not null' will return a precision of 0.
This occurs when obtaining the metadata from a table that was altered by adding a new column of type NUMBER that has a default value and is not null.
For example, if you have the following database structure where the second column added is not null and has a default value.



where Column B should return a precision of 1.

The problem does not occur if not using default value or null value.
This issue occurs using database version 11.1.0.6 and 11.2.0.1 (regardless of the JDBC driver version used).

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.