Number of rows in a cursor
Posted in 1994
Sorry if this got out already...my poster seems muffed up. I'm trying to find the number of rows contained in a cursor. I'm 'porting' an ESQL/C 4.10 app to ESQL/C for Windows 5.01. We used to use the _SQCfirst member of _SQCURSOR to get a number of rows in a cursor. This seemed to work great in 4.10, but this value always seems to be 0 in ESQL/C 5.01, except for scroll cursors. I've tried looking at the fields (which always seem to be out of date) in the sqlca communications area and things like: $char szDatabaseName = "host"; $char login_name[30]; $char szRowsInTable[30]; $char szRowsInCursor30]; $database $szDatabaseName; /* the following line works fine */ $select count(*) into $szRowsInTable from users; $prepare selection_stmt from "select login_name from users"; $declare users_cursor cursor for selection_stmt; /* the following line doesn't work at all */ $select count(*) into $szRowsInCursor from users_cursor; for(;;) { /* fetch processing goes here */ } $close users_cursor $free selection_stmt $close szDatabaseName -- "The next revolution will be computerized..." - jj