home *** CD-ROM | disk | FTP | other *** search
- 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
- From: brownlow@informix.com (Keith Brownlow)
- Newsgroups: comp.databases.informix
- Subject: Re: ESQL C problem with sqlerrd[2]
- Message-ID: <brownlow.724615082@xanadu>
- Date: 17 Dec 92 17:58:02 GMT
- References: <1giuitINNcgq@emory.mathcs.emory.edu> <1992Dec14.230122.22841@unlv.edu>
- Sender: news@informix.com (Usenet News)
- Organization: Informix Software, Inc.
- Lines: 24
-
- ray@unlv.edu (Ray Tripamer) writes:
-
- >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.
- >--
-
-
- A little clarification at this point;
-
- sqlca.sqlerrd[2] holds the values of the last SERIAL value inserted.
-
- sqlca.sqlerrd[3] will hold the TRUE number of updates and deletes but only
- the first of an insert or select. This is because both insert and select
- statements need cursors if they are to manipulate more than one row at a time,
- while update or deletes will affect every row in the table unless some
- criteria is specified.
-
- Hope this clears up any misunderstanding.
-