home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / informix / 2693 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.3 KB  |  34 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!nevada.edu!jimi!ray
  3. From: ray@unlv.edu (Ray Tripamer)
  4. Subject: Re: ESQL C problem with sqlerrd[2]
  5. Message-ID: <1992Dec14.230122.22841@unlv.edu>
  6. Originator: ray@lil-ed.cs.unlv.edu
  7. Sender: news@unlv.edu (News User)
  8. Organization: University of Nevada, Las Vegas
  9. References: <1giuitINNcgq@emory.mathcs.emory.edu>
  10. Date: Mon, 14 Dec 92 23:01:22 GMT
  11. Lines: 21
  12.  
  13. In article <1giuitINNcgq@emory.mathcs.emory.edu> kristen.m.altman@ccd.harris.com (Kristen Altman) writes:
  14. >In my application, I am using ESQL C 4.1 and formatting dynamic SQL stmts.
  15. >
  16. >After the first fetch the number of rows returned in sqlerrd[2]
  17. >is 0, but the sqlca.sqlcode = 0 also.  If I understand this correctly,
  18. >the sqlerrd[2] says there are no rows, but the sqlcode says there are rows.  
  19. >-- 
  20. >Kristen Altman
  21. >kma@ccd.harris.com
  22.  
  23. The sqlca.sqlerrd[2] value DOES NOT hold the number of rows found by opening
  24. a cursor for a select statement (dynamic or otherwise).  The sqlerrd[2] value
  25. is filled in only by the update and delete statements (maybe insert too), but
  26. not by a select.
  27.  
  28. The only way to get the number of rows from a select statment is to
  29. execute some type of "select count(*) into $cnt ..." statement with the same
  30. from and where clause as the original select statement.
  31. --
  32. Ray Tripamer
  33. ray@asci.com
  34.