Troubleshooting
Problem
How to resolve SQL0501N error when a SELECT statement is issued from a DB2 Client command line or Control Center connecting to a DB2 database running on z/OS?
Symptom
SQL statement issued from DB2 client command line
db2 "select count(*) from sysibm.sysvolumes";
Result:
SQL0965W There is no message text corresponding to SQL warning "98" in the message file on this workstation. The warning was returned from module "DSNHTOKR" with original tokens "". SQLSTATE=01568
SQL0501N The cursor specified in a FETCH statement or CLOSE statement is not open or a cursor variable in a cursor scalar function reference is not open. SQLSTATE=24501
Snippet of db2trace.fmt from DB2 Client showing -501 error:
- 7224 data DB2 UDB command line process clp_fetch_rows fnc
(3.3.41.55.0.111)
pid 2568 tid 964 cpid -1 node 0 sec 86 nsec 990584299 probe 111
bytes 144
Data1 (PD_DB2_TYPE_SQLCA,136) SQLCA:
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -501 sqlerrml: 0
sqlerrmc:
sqlerrp : SQLACALL
sqlerrd : (1) 0x8000008C (2) 0x0000008C (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 24501
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
30 April 2025
UID
swg21515847