Peter
Peter

Reputation: 393

Oracle integer stored with comma

I look at a oracle database and there is a column named score it is declared as INT(12,2).

The values that are stored there look like this:
23487.31
0
322.3

So does it mean those are actual float values?
I really crawled through the oracle data type documentation but couldn't find any information regarding the notation of INT(a,b).
(Source: https://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT012)

Edit: SELECT * FROM v$version; gives me:

Oracle Database 10g Release 10.2.0.5.0 - Production
PL/SQL Release 10.2.0.5.0 - Production
CORE    10.2.0.5.0      Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production

Upvotes: 0

Views: 187

Answers (1)

APC
APC

Reputation: 146229

So does it mean those are actual float values?

No. Those are numbers with a defined precision of two decimal places.

Oracle supports a FLOAT datatype but it is represented internally as NUMBER. If you want genuine floating-point operations for faster arithmetic it has BINARY_FLOAT and BINARY_DOUBLE.


why can't I find anything about the notation of INT(a,b)?

Because it's not valid Oracle notation. INT is allowed as a synonym of INTEGER, but it doesn't permit scale or precision parameters. If you try to include them Oracle hurls ORA-00907. (The precision would be nugatory anyway, because an integer can have a precision of zero.)

Upvotes: 2

Related Questions