View previous topic :: View next topic |
Author |
Message |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Fri Dec 14, 2007 12:19 pm Post subject: SELECT COUNT(*) failing with -802 SQLCODE |
|
|
One of our developers is running a DSNTEP2 job to determine the number of rows on a production table.
He is getting a -802 error, which leads me to believe that it is because the number of rows on the table exceeds the highest allowable number for an integer type value (I believe a COUNT(*) returns an integer).
I know from past RUNSTATS that there were over 2 billion rows on this table on an earlier date. What type of SQL can be written to determine
the count of rows on this table?
Note: I am trying SELECT DECIMAL(COUNT(*)) from THE_TABLE, but I'm not sure it won't return an error again. |
|
Back to top |
|
 |
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Fri Dec 14, 2007 12:29 pm Post subject: |
|
|
I don't think that will work. Try COUNT_BIG(*). COUNT_BIG returns a DECIMAL(31,0). |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Dec 17, 2007 8:42 am Post subject: |
|
|
Thanks. COUNT_BIG is what I was looking for. |
|
Back to top |
|
 |
|
|