Skip to Content.
Sympa Menu

freetds - RE: Another ODBC command..

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James K. Lowden <jklowden AT speakeasy.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: RE: Another ODBC command..
  • Date: Mon, 30 Sep 2002 23:43:52 -0400


On 30 Sep 2002 17:19:06 -0600, "Ross Simpson" <mqsimpson AT aol.com> wrote:
> Talking to the developer who wrote the application I'm trying to use
> with FreeTDS, he said the reason he used SQLExtendedFetch was to be able
> to get a subset of the returned recordset -- i.e., get the first 10
> results, process them, then get the next 10, process those, etc. etc.
>
> My question is, are cursors necessary for this purpose? The application
> will never ask for results out of order, or ask for a previous result --
> it just wants to process the records in batches instead of all at once.

Ross,

I'm not an ODBC programmer and I don't play one on TV, so I can't give you
specific guidance. But the answer is, no, you don't need a cursor to
fetch rows in order.

Here's a rule of thumb: Never use a cursor. Cursor's are for Lame Janes
who think a result set is what you get when you step in wet concrete. Get
your rows from the server as they're sent, and do with them what you will,
but don't turn the SQL Server into a for() loop.

(I realize this wasn't your design. I thought you might enjoy passing on
passed judgement. :)

I don't see anything in your description that couldn't be handled simpler
and easier with SQLFetch. Just one man's opinion, of course. I'm sure
there are others.

Regards,

--jkl



  • RE: Another ODBC command.., James K . Lowden, 10/01/2002

Archive powered by MHonArc 2.6.24.

Top of Page