Skip to Content.
Sympa Menu

freetds - [freetds] Supporting fast forward-only cursors?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Sebastien FLAESCH <sf AT 4js.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Supporting fast forward-only cursors?
  • Date: Thu, 10 Jan 2008 14:57:06 +0100

So far I have one remaining "FIXME" comment in my FreeTDS driver interface,
regarding fast forward cursors...

With the native MSSQL ODBC drivers, when you set:

r = SQLSetStmtAttr(st->stmtHandle, SQL_SOPT_SS_CURSOR_OPTIONS, (SQLPOINTER)
SQL_CO_FFO, SQL_IS_UINTEGER);

You get fast forward-only cursors, as described in:

http://msdn2.microsoft.com/en-us/library/aa172573.aspx

Note this is a SQL Server 2000 feature...

Other link:

http://msdn2.microsoft.com/en-us/library/aa177106(SQL.80).aspx

I was wondering how difficult it would be to support this MSSQL specific
statement attribute...

If it's just a matter of sp_cursoroption, then you should...

Attached a sample (must compile with -D USE_FAST_FOWARD to use FFO cursor)

I noticed that SQL Profiler should different values in the @p5 and @p6
parameters of the sp_cursorprepexec() call:

With FFO:

@p5=16
@p6=1

With SQL_NONSCROLLABLE / SQL_SENSITIVE:

@p5=4
@p6=4

Tested with SQL Server 2005 ...

Thanks!
Seb




Archive powered by MHonArc 2.6.24.

Top of Page