Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle DB returning negative scale and 0 precision using JDBC

I created a column in a table in my oracle DB of type NUMBER but in creating this column, I left the precision and scale blank.

When I was using the java.sql's ResultSetMetadata class to obtain the column information, I got back that the column precision was 0 and that the scale was -127.

The Oracle docs say that

The absence of precision and scale designators specifies the maximum range and precision for an Oracle number.

But what does that mean in this case? How is the precision being returned equal to 0 and the scale a negative number?

Should I be obtaining the scale and precision in a different manner?

like image 239
Karan Avatar asked Oct 28 '25 04:10

Karan


1 Answers

Oracle returns -127 when the scale is unspecified. This is mentioned in the: JavaDoc.

like image 54
Jean de Lavarene Avatar answered Oct 29 '25 17:10

Jean de Lavarene



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!