Re: ESQL C problem with sqlerrd[2]
Posted in 1992
In article <1giuitINNcgq@emory.mathcs.emory.edu> kristen.m.altman@ccd.harris.com (Kristen Altman) writes: >In my application, I am using ESQL C 4.1 and formatting dynamic SQL stmts. > >After the first fetch the number of rows returned in sqlerrd[2] >is 0, but the sqlca.sqlcode = 0 also. If I understand this correctly, >the sqlerrd[2] says there are no rows, but the sqlcode says there are rows. >-- >Kristen Altman >kma@ccd.harris.com The sqlca.sqlerrd[2] value DOES NOT hold the number of rows found by opening a cursor for a select statement (dynamic or otherwise). The sqlerrd[2] value is filled in only by the update and delete statements (maybe insert too), but not by a select. The only way to get the number of rows from a select statment is to execute some type of "select count(*) into $cnt ..." statement with the same from and where clause as the original select statement. -- Ray Tripamer ray@asci.com