views:

54

answers:

1

What SQL data type does Oracle assign to count(*) in a query like select count(*) from table? Does this depend on the count size?

+7  A: 

The value is an integer; Oracle only has a NUMBER data type.

OMG Ponies
This leads to my next question at http://stackoverflow.com/questions/3504521/what-java-data-type-corresponds-to-the-oracle-sql-data-type-numeric.
Derek Mahar
@Derek Mahar: Somehow, I knew that was the ultimate question... :)
OMG Ponies
@OMG: So you may get rep for two answers for the price of one ultimate question!
Derek Mahar
@Derek Mahar: Nah, I was close - it's been over a year since I worked with Java/Oracle, and I don't have my source handy to check.
OMG Ponies
@OMG, Just FYI, Oracle does have an INTEGER datatype. It's internally implemented as a NUMBER, but the type exists.
DCookie
@DCookie: Thx, yeah - knew that Oracle subtypes the data types but they're all NUMBER ultimately.
OMG Ponies