The CUrsor based on a query which contains count(coulumn_name).
In Fetch :
When i display ws-count it does n't show any value i.e spaces (i do n't emember exactly it is periods (...).
Note : While running query at QMF its show a value in the count value.But in my program the query is not giving the actual result in the cursor.
Can any body help me why i am not getting the acctual value.
If you want the count, you can check the count in the following variables also after the SQL stament.
SQLERRD(1) |The number of rows in the result table of a cursor when the cursor position |is after the last row (when SQLCODE is equal to +100). This field is not set |for
FETCH [[NEXT | PRIOR | FIRST | LAST | ABSOLUTE n | RELATIVE n] FROM]
[INTO @variable_name1, @variable_name2, ...]
dynamic scrollable cursors.
|| |SQLERRD(2) |The number of rows in the result table of a cursor when the cursor position |is after the last row (when SQLCODE is equal to +100). This field is not set |for dynamic scrollable cursors.
|| |SQLERRD(3) |The number of rows in the result table of an INSERT when the SELECT |statement of the cursor contains the INSERT statement.
SQLERRD5 contains an indication that the last row in the table was fetched. It can be used to detect the end-of-data condition in the table being fetched .
Fetch Count for Cursors (BUT I COULDN'T DO USING THIS OPTION)
Normally, the select @@rowcount command returns the number of
rows actually returned to the client as a result of the most recent
request. However, on DB2, when a cursor is open and results are
fetched, select @@rowcount returns the number of rows in the fetch
count for that cursor. This may differ from the number of rows
actually returned, depending upon how the cursor is used.
The sqlerrd's give values in hex i suppose.
please let me know if you could get the count using the above.