Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.
Дата
Msg-id 5315E154.3080406@vmware.com
обсуждение исходный текст
Ответ на SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.  (Przemyslaw Rzepecki <przemyslaw.rzepecki@ericsson.com>)
Ответы Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.  (Przemyslaw Rzepecki <przemyslaw.rzepecki@ericsson.com>)
Список pgsql-odbc
On 11/26/2013 10:13 AM, Przemyslaw Rzepecki wrote:
> Hi,
>
> I have encountered some problems with SQLFetchScroll when
> SQL_ATTR_ROWS_FETCHED_PTR attribute is set. The statement is closed
> after first call to SQLFetchScroll. This first call is successful the
> numbers of fetched rows correct, but the statement handle, is after the
> call, invalid and can not be used in any other SQLFetchScroll calls.
>
> // table test with 'id' integer column and 20 rows.
> The code looks like that:
> alloc_stmt(hdbc, &hstmt);
> SQLPrepare(hstmt, (SQLCHAR *)"select * from test", SQL_NTS);
> SQLExecute(hstmt);
> SQLSetStmtAttr(hstmt, SQL_ATTR_ROWS_FETCHED_PTR, &rowsFetched, 0);
> SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, 1, 0);
> SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_STATUS_PTR, rowStatus, 0);
> SQLBindCol(hstmt, 1, SQL_C_LONG, idout, sizeof(SQLINTEGER), indicator);
> SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 0);
> // all above is success and  rowStatus and idout arrays are correctly
> // updated.
>
> SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 0);
> // fails with error INVALID HANDLE
>
> Is my usage of the fetch scroll function incorrect?

Looks correct to me. I tried to reproduce this with the attached test
program (modified from the regression tests), and it worked fine.

- Heikki

Вложения

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Code inconsistency in convert.c for guid -> string conversion
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: SQLGetTypeInfo does not return COLUMN_SIZE