Skip to Content.
Sympa Menu

freetds - RE: [freetds] dbnextrow() question

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] dbnextrow() question
  • Date: Tue, 8 Mar 2005 18:19:02 -0000

Easy, cowboy.

well, *might* is right , if you'll excuse the pun - as there is one
circumstance when it wouldn't go wrong.

On the other hand, I *might* not have had the time to go into all the
gory details :-)

Yours non-specifically,

Bill

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Lowden, James K
Sent: 08 March 2005 17:57
To: ml AT freetds.org
Subject: RE: [freetds] dbnextrow() question


> From: Thompson, Bill D (London)
> Sent: Tuesday, March 08, 2005 6:01 AM
>
> your next call to dblibrary *might* fail with a "results pending" type
> error though, if you tray and do another operation on the same channel

What "might"? *Will* fail, period.

The code below doesn't tell the server to stop sending rows, and doesn't
tell the library the that the result set was exhausted/cancelled.
db-lib maintains information about the state of the connection, and will
refuse to send another query. Anything else is a bug.

The only exception would be if the last row fetched happened also to be
the last row sent, i.e., the last row of the result set. Some
implementations of db-lib (not FreeTDS, afaik), will note the
end-of-rowset packet and update the internal connection status
automatically. Others will not do so until dbnextrow returns
NO_MORE_ROWS.

Am I missing something?

--jkl


>
> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of craigs
> Sent: 08 March 2005 10:58
> To: FreeTDS Development Group
> Subject: Re: [freetds] dbnextrow() question
>
>
> found an easier way of doin it.
>
> while (dbnextrow(dbconn) != NO_MORE_ROWS)
> {
> if ( find what i want )
> {
> do something here
> now exit doing the following
>
> return NO_MORE_ROWS; // this will let you exit
> }
> }
>
>
> Thompson, Bill D (London) wrote:
>
> >Shaun
> >
> >see dbcanquery() or dbcancel() . dbcanquery looks like exactly what
you
> >want.
> >
> >-----Original Message-----
> >From: freetds-bounces AT lists.ibiblio.org
> >[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of craigs
> >Sent: 04 March 2005 12:19
> >To: FreeTDS Development Group
> >Subject: [freetds] dbnextrow() question
> >
> >
> >Could someone tell me how to exit this loop? I dont want to run
> through
> >
> >thousands of unnecessary records when i find the one i want.
> >
> >while (dbnextrow(dbconn) != NO_MORE_ROWS)
> >{
> > if ( find what i want )
> > {
> > do something here
> > now i want to exit out off this loop
> > }
> >}
> >
> >Shaun

-----------------------------------------
The information contained in this transmission may contain privileged
and confidential information and is intended only for the use of the
person(s) named above. If you are not the intended recipient, or an
employee or agent responsible for delivering this message to the
intended recipient, any review, dissemination, distribution or
duplication of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender immediately by reply
e-mail and destroy all copies of the original message. Please note that
we do not accept account orders and/or instructions by e-mail, and
therefore will not be responsible for carrying out such orders and/or
instructions.
If you, as the intended recipient of this message, the purpose of which
is to inform and update our clients, prospects and consultants of
developments relating to our services and products, would not like to
receive further e-mail correspondence from the sender, please "reply" to
the sender indicating your wishes. In the U.S.: 1345 Avenue of the
Americas, New York, NY 10105.


_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain or
redistribute it. Click here for important additional terms relating to this
e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------





Archive powered by MHonArc 2.6.24.

Top of Page