home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.informix
- Path: sparky!uunet!nevada.edu!jimi!ray
- From: ray@unlv.edu (Ray Tripamer)
- Subject: Re: ESQL C problem with sqlerrd[2]
- Message-ID: <1992Dec14.230122.22841@unlv.edu>
- Originator: ray@lil-ed.cs.unlv.edu
- Sender: news@unlv.edu (News User)
- Organization: University of Nevada, Las Vegas
- References: <1giuitINNcgq@emory.mathcs.emory.edu>
- Date: Mon, 14 Dec 92 23:01:22 GMT
- Lines: 21
-
- 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
-