[freetds] Want to use fast forward cursors (SQL_CO_FFO) and MARS

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon May 5 03:39:19 EDT 2008

> Hi all,
> I had a little review of our code and found a unique "FIXME" 
> to resolve:
> /* FIXME!
>      } else {                    / * Use fast forward cursor * /
>          r = SQLSetStmtAttr(st->stmtHandle, 
>                             (SQLPOINTER) SQL_CO_FFO, SQL_IS_UINTEGER);
>          if (!SQL_SUCCEEDED(r)) {
>              DBGMSG(1, "Could not set SQL_SOPT_SS_CURSOR_OPTIONS");
>              return -1;
>          }
> */
> With the native SQL Server ODBC drivers (SNAC and MDAC), this option
> can be used from the odbcss.h header.
> Are there any plans to support this?
> BTW: What about MARS (Multiple Active Result Sets)?
> Thanks a lot!
> Seb

Currently there is no plan. However there are some things that we need
to address. ODBC has mainly ABI compatibility for constants. That is the
same constant has the same value on all platforms. Constants defined in
odbcss.h are not (correctly) in standard headers so we must define these
constants in some way. Where to define these constants? Should we create
a tdsodbcss.h header?? Or should we install it as odbcss.h?? Should we
install this header or not?? I think that these constant should be
defined when tdsodbc.h is included (this not means that these constants
have to be defined in tdsodbc.h!) so c source files won't change.

And back to fast forward cursors, when is it possible to set fast
cursors? Only after setting some types of cursors? Does setting fast
cursors can change cursor type? Setting fast forward cursors is just an
advise that is used only with some cursors type (that is you can set for
all cursor types but used only on some values) or setting with improper
cursor type give error/warning ?? And what happen if we try to move
cursor position on a read-only forward only cursor (this apply not only
to fast forward) ?? I think all these questions should we answered with
a test.

On fast forward implementation code should detect that we reached the
end of rows and set state to close and deallocated automatically. Also
odbc code should set some cursor types correctly in order to open fast
forward cursors instead of normal one.


More information about the FreeTDS mailing list