Kbase P125869: SQL COUNT function returns a SQL BigInt data-type in OpenEdge 10.1B
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/13/2007 |
|
Status: Unverified
FACT(s) (Environment):
OpenEdge 10.1B
SYMPTOM(s):
SQL statement uses COUNT function:
SELECT COUNT(<field>) FROM pub.<table>
Query returns a SQL BigInt data-type (e.g. Long)
Same query returns an Integer value in Progress 9.1x
CHANGE:
Upgraded to OpenEdge 10.1B
CAUSE:
This is expected behaviour. OpenEdge 10.1B uses a 64-bit integer (a SQL BigInt type) for the result of a SQL COUNT(). This is because of the large increase in database and table sizes possible in OpenEdge 10.1B with 64-bit rowids. In previous Progress/OpenEdge releases, a COUNT returned a 32-bit integer.
FIX:
CAST the result of the COUNT function as an INTEGER data-type in the query:
SELECT CAST(COUNT(<field>) AS INTEGER) AS <alias> FROM pub.<table>
Alternatively this can be done in the application code.