![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Bug to report - For a numeric in a table defined by: CREATE TABLE SERG (F01NUM NUMERIC) ; , the precision and scale reported by ResultSetMetaData.getScale() and ResultSetMetaData.getPrecision() are value -1 |
#2
| |||
| |||
|
|
Sergio Lob wrote: Bug to report - For a numeric in a table defined by: CREATE TABLE SERG (F01NUM NUMERIC) ; , the precision and scale reported by ResultSetMetaData.getScale() and ResultSetMetaData.getPrecision() are value -1 What should they return instead in this case? -O |
#3
| |||
| |||
|
|
Precision is the number of total digits in the number. Scale is the number of fractional digits. For instance, a column defined as NUMERIC(10,3) should return precision=10, scale=3. The error only occurs for a column defined as NUMERIC (without precision or scale specified). Presumably, there is a default precision and scale assigned to the column by postgreSQL, which is not -1. |
#4
| |||
| |||
|
|
Precision is the number of total digits in the number. Scale is the number of fractional digits. For instance, a column defined as NUMERIC(10,3) should return precision=10, scale=3. The error only occurs for a column defined as NUMERIC (without precision or scale specified). Presumably, there is a default precision and scale assigned to the column by postgreSQL, which is not -1. |
#5
| |||
| |||
|
|
Precision is the number of total digits in the number. Scale is the number of fractional digits. For instance, a column defined as NUMERIC(10,3) should return precision=10, scale=3. |
|
The error only occurs for a column defined as NUMERIC (without precision or scale specified). Presumably, there is a default precision and scale assigned to the column by postgreSQL, which is not -1. |
#6
| |||
| |||
|
|
There appears to be no default, which is why we currently return -1. |
|
Scale should default to 0 per the standard, but defaults to whatever the precision is in PostgreSQL (see the docs for details). |
![]() |
| Thread Tools | |
| Display Modes | |
| |