Skip to Content.
Sympa Menu

freetds - RE: [freetds] Multiple result sets?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Multiple result sets?
  • Date: Thu, 11 Sep 2003 10:39:37 -0400

> From: Bernt Andreas Drange [mailto:Bernt.Andreas.Drange AT imr.no]
> Sent: September 11, 2003 2:45 AM
>
> Oh, and to clarify a bit: My question did not relate to queries that
> return two result sets at once, but to whether it is possible
> to run one
> query first, and then another - allowing you to work with two $results
> at once..

Bernt,

The upper layers can play games, but as far as the server is concerned, a
client must receive all rows from a result set, or cancel the query, before
issuing a new query on the same connection. That's a property of the TDS
protocol.

If you issue a query that returns 100 rows, fetch 20 rows, and then attempt
to issue a new query, you should get an error message indicating there are
"pending results". The server requires you to either fetch the remaining 80
rows, or cancel the query (allowing it to discard the rows) before
proceeding.

Server-side cursors on Sybase change things a bit. FreeTDS doesn't support
them (yet), however.

When I said "play games", I meant that nothing prevents a higher layer from
opening a new connection to manage a second result set. Perl's DBD::Sybase
does that sometimes. From what I read about PHP, I doubt it does anything
so fancy.

HTH.

--jkl
-----------------------------------------
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.






Archive powered by MHonArc 2.6.24.

Top of Page