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

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!spool.mu.edu!olivea!gossip.pyramid.com!pyramid!infmx!xanadu!brownlow
  2. From: brownlow@informix.com (Keith Brownlow)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: ESQL C problem with sqlerrd[2]
  5. Message-ID: <brownlow.724615082@xanadu>
  6. Date: 17 Dec 92 17:58:02 GMT
  7. References: <1giuitINNcgq@emory.mathcs.emory.edu> <1992Dec14.230122.22841@unlv.edu>
  8. Sender: news@informix.com (Usenet News)
  9. Organization: Informix Software, Inc.
  10. Lines: 24
  11.  
  12. ray@unlv.edu (Ray Tripamer) writes:
  13.  
  14. >The sqlca.sqlerrd[2] value DOES NOT hold the number of rows found by opening
  15. >a cursor for a select statement (dynamic or otherwise).  The sqlerrd[2] value
  16. >is filled in only by the update and delete statements (maybe insert too), but
  17. >not by a select.
  18.  
  19. >The only way to get the number of rows from a select statment is to
  20. >execute some type of "select count(*) into $cnt ..." statement with the same
  21. >from and where clause as the original select statement.
  22. >--
  23.  
  24.  
  25. A little clarification at this point;
  26.  
  27.  sqlca.sqlerrd[2] holds the values of the last SERIAL value inserted.
  28.  
  29. sqlca.sqlerrd[3] will hold the TRUE number of updates and deletes but only
  30. the first of an insert or select.  This is because both insert and select 
  31. statements need cursors if they are to manipulate more than one row at a time, 
  32. while update or deletes will affect every row in the table unless some 
  33. criteria is specified.
  34.  
  35. Hope this clears up any misunderstanding.
  36.