From: | Przemyslaw Rzepecki <przemyslaw(dot)rzepecki(at)ericsson(dot)com> |
---|---|
To: | <pgsql-odbc(at)postgresql(dot)org> |
Subject: | SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement. |
Date: | 2013-11-26 08:13:16 |
Message-ID: | 1385453596.4529.206.camel@salti.rnd.ki.sw.ericsson.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
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?
I am using unixODBC version: 2.3.1
with psqlodbc-09.02.0100 driver
and Postgresql 9.3.1 server.
Kind regards,
Przemyslaw
From | Date | Subject | |
---|---|---|---|
Next Message | thatsmeneo . | 2013-11-26 17:01:56 | psqlodbc library |
Previous Message | Przemyslaw Rzepecki | 2013-11-25 09:05:51 | Re: SQLCopyDesc to copy rows between tables |