home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / database / informix / 2802 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  2.3 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!spool.mu.edu!olivea!gossip.pyramid.com!pyramid!infmx!davek
  2. From: davek@informix.com (David Kosenko)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: ESQL C and sqlerrd[2]
  5. Message-ID: <1992Dec21.173203.9158@informix.com>
  6. Date: 21 Dec 92 17:32:03 GMT
  7. References: <1glao7INNhgu@emory.mathcs.emory.edu>
  8. Sender: news@informix.com (Usenet News)
  9. Organization: Informix Software, Inc.
  10. Lines: 42
  11.  
  12. Kristen Altman writes:
  13. >I am receiving replies to my original message about fetch
  14. >returning 0 in sqlerrd[2] while sqlcode = 0.  The messages 
  15. >all say that sqlerrd[2] does not return the number of rows.
  16. >
  17. >I am using ESQL/C version 4.1 and sqlerrd[2] DOES return the
  18. >number of rows in the active set.  This application I have
  19. >written works 99% of the time with sqlerrd[2] returning the
  20. >number of rows.  In fact, I got the idea to look at that 
  21. >variable for the number of rows from Dave Snyder (and I believe
  22. >he knows what he is talking about).  
  23. >
  24. >In the ESQL/C manual it saya:
  25. >    ...
  26. >    sqlerrd[2] is the number of rows processed.
  27. >    ...
  28. >
  29. >Therefore, does anyone have any idea what's going on with
  30. >this??
  31.  
  32. I thought we had covered this, but I guess not.  It does indeed contain
  33. the number of rows processed.  The question is, when does it get
  34. filled in?  When you use a cursor, a bufferfull of rows are gathered by
  35. your server, and sent to the client when requested by a fetch.  If all
  36. the rows in your set will fit in the buffer, then the entire number of
  37. rows returned is known, and sqlerrd[2] is filled in.  If the buffer will
  38. NOT hold the entire set, then only a bufferfull is retrieved, and the total
  39. number of rows in the set is not known.  When the last bufferfull is
  40. retrieved from the db, the number will be known and sqlerrd[2] will be
  41. filled in.
  42.  
  43. SO 99% of the time, you are getting all your rows in the first bufferfull.
  44. The remaining 1% of the time require more than a single buffers worth.  In
  45. those cases sqlerrd[2] will be filled in after the fetch that causes the
  46. last bufferfull to be retrieved.
  47.  
  48. Dave
  49. -- 
  50. Disclaimer: These opinions are not those of Informix Software, Inc.
  51. **************************************************************************
  52. "I look back with some satisfaction on what an idiot I was when I was 25,
  53.  but when I do that, I'm assuming I'm no longer an idiot." - Andy Rooney
  54.