Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement. - Mailing list pgsql-odbc

From Heikki Linnakangas
Subject Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.
Date
Msg-id 53199880.1060107@vmware.com
Whole thread Raw
In response to Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.  (Nick Gorham <nick@lurcher.org>)
List pgsql-odbc
On 03/07/2014 11:48 AM, Nick Gorham wrote:
> I hope you don't mind me posting to your list as a observer, but I
> noticed the following in the original code
>
> SQLINTEGER int_array[ARRAY_SIZE];
>
>       /* Bind */
>       rc = SQLBindCol(hstmt, 1, SQL_INTEGER, int_array, sizeof(SQLLEN),
> ind_array);
>       CHECK_STMT_RESULT(rc, "SQLBindCol failed", hstmt);
>
> I would have thought
>
>       /* Bind */
>       rc = SQLBindCol(hstmt, 1, SQL_INTEGER, int_array,
> sizeof(SQLINTEGER), ind_array);
>       CHECK_STMT_RESULT(rc, "SQLBindCol failed", hstmt);
>
> Was what it should have been. The driver will have written past the end
> of int_array, and overwritten the handle (I guess).

The buffer-length argument is ignored with fixed-length data. Although I
agree on readability grounds that it should be sizeof(SQLINTEGER), to
match SQL_INTEGER, or 0 to make it clear that it's ignored.

- Heikki


pgsql-odbc by date:

Previous
From: Nick Gorham
Date:
Subject: Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.
Next
From: "Itnal, Prakash (NSN - IN/Bangalore)"
Date:
Subject: 09.03.0100 is not compatible with Postgres-9.1.x