Skip to Content.
Sympa Menu

freetds - Re: [freetds] possible SQLMoreResults/SQLNumResultCols bug

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] possible SQLMoreResults/SQLNumResultCols bug
  • Date: Tue, 5 Feb 2008 11:01:37 -0500

ZIGLIO, Frediano, VF-IT wrote:
> > I see no way for the application to know it shouldn't call
> > SQLGetData() after SQLNumResultCols() returns nonzero.
>
> The application should call SQLFetch before SQLGetData.

Oh!

> In odbc 3 you
> can have even resultset without columns (like inserts or updates!)

Well, OK, but there's nothing to fetch. You just mean you can call
SQLRowCount, right?

For this query:

INSERT T VALUES (2)
UPDATE T SET t = 1
DELETE T

I would expect:

1. SQLExecute, SQL_SUCEED
2. SQLNumResultCols, 0
3. SQLRowCount, 1
4. SQLMoreResults, TRUE
5. SQLExecute, SQL_SUCEED
6. SQLNumResultCols, 0
7. SQLRowCount, 1
8. SQLMoreResults, TRUE
9. SQLExecute, SQL_SUCEED
10. SQLNumResultCols, 0
11. SQLRowCount, 1
12. SQLMoreResults, FALSE

Yes?

Thanks for the SQLFetch advice. The documentation isn't terribly plain,
and it wasn't until this morning, after getting your message, that I found
an example (from IBM) for SQLMoreResults.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page