ResultSetMetaData getScale(n) Returns -127 on SQL CASE Numeric Expression after database upgrade to version 12.2 and higher
(Doc ID 2948197.1)
Last updated on MAY 18, 2023
Applies to:JDBC - Version 188.8.131.52.0 and later
Information in this document applies to any platform.
After migrating the database from version 12.1 to 19c a JDBC application no longer works due to the ResultSetMetaData getScale calls returning the wrong value.
The ResultSetMetaData getScale call is used to obtain information on a column data type from the ResultSet of a query, in particular, on the precision of a NUMBER type.
Consider the following fragment of code
The CASE expression returns a numeric value. The datatype of this expression does not have a defined precision.
With the database version 184.108.40.206 and lower, the getScale() returns 0.
Starting with database version 220.127.116.11 and including versions 19c and 21c the getScale() returns -127.
This is true irrespective of the JDBC driver version and applicable to JDBC/thin and JDBC/OCI.
The JDBC driver has no say on what the getScale method returns, as this value is provided by the database.
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