Ralf Grewe (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
) *commented* on HHH-16697 (
https://hibernate.atlassian.net/browse/HHH-16697?atlOrigin=eyJpIjoiYjNkNz...
)
Re: CALCULATED FIELDS in createNativeQuery doExtract integer insted of BigDecimals. (
https://hibernate.atlassian.net/browse/HHH-16697?atlOrigin=eyJpIjoiYjNkNz...
)
Oracle JDBC Driver always returns zero for both “ResultSetMetaData.getScale()” and
“ResultSetMetaData.getPrecision()” in case you use aggregate functions. Oracle support
document 1587538.1 states that Precision and Scale are not available when using SQL
functions and that this is expected behaviour, e.g.: if you create the following VIEW:
SQL> create view <VIEW NAME> as select max(<COLUMN NAME>) max_c1 from
<TABLE NAME>;
…and then run a “DESCRIBE” on the VIEW:
SQL> desc <VIEW NAME>
Name Null? Type
----------------------------------------- -------- ----------------------------
MAX_C1 NUMBER
…you will notice that no Scale nor Precision has been packaged with the datum which in
return means that JDBC also just returns the datatype given by the server. For
'normal' columns the data dictionary core catalogs are queried to obtain
information like precision and scale . However, since for aggregate function the result of
such functions do not exist in these catalogs, then they are unknown.
Oracle Document 1946626.1 delivers some details on how to interpret the precision and
scale values
(
https://hibernate.atlassian.net/browse/HHH-16697#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16697#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:e03cc87 )