From: Nick Gorham <nick@lurcher.org>
To: pgsql-odbc@postgresql.org
Subject: Re: ODBC : SQLGetData question
Date: Wed, 14 May 2014 09:32:20 +0100
Message-ID: <53732A14.1000001@lurcher.org> (raw)
In-Reply-To: <CALSLE1MSthQPLGdKDPC9cTozFSqWDzBeZtz6VnavY-Xjik6fGw@mail.gmail.com>
References: <CALSLE1P5zWBBckGQaOKQzcN-jkR_nn5PSno_b-iRS6cR4H=uvA@mail.gmail.com>
<53730FFB.5020304@gmail.com>
<CALSLE1MLEDoi4aoEQdE093yJBJygATTFWYhTvgAqhsEDYvJ0Uw@mail.gmail.com>
<CALSLE1MSthQPLGdKDPC9cTozFSqWDzBeZtz6VnavY-Xjik6fGw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
On 14/05/14 08:46, Dev Kumkar wrote:
> On Wed, May 14, 2014 at 12:51 PM, Dev Kumkar <devdas.kumkar@gmail.com
> <mailto:devdas.kumkar@gmail.com>> wrote:
>
> On Wed, May 14, 2014 at 12:10 PM, aihtdikh <aihtdikh@gmail.com
> <mailto:aihtdikh@gmail.com>> wrote:
>
> Hi,
>
> SQLGetData expects the buffer length parameter to be a SQLLEN
> variable, which is a signed type.
> SQL_NULL_DATA is defined as -1, which is 4294967295 if you
> interpret it as an unsigned type.
>
> Your my_buff_len variable is being set to SQL_NULL_DATA
> correctly, but you are looking at it wrong.
> Change it to be the correct type, and it will work as you expect.
>
> Regards,
> Harun
>
>
> Thanks for the reply.
>
> my_buff_len is defined as SQLLEN
> SQLLEN my_buff_len;
>
>
> SQLGetData(my_stmt, my_col_no, SQL_C_CHAR, &my_max_len, 0,
> &my_buff_len)
>
> if (my_buff_len == SQL_NULL_DATA)
> {
> // Doesn't come here
> }
>
> What is being missed above?
>
> Regards...
>
>
> if ((int)my_buff_len == SQL_NULL_DATA)
> {
> // will come here
> }
>
> The above casting solves the problem, please review?
>
> Regards...
Just to suggest.
I would guess the application expects sizeof( SQLLEN ) == 8 and the
driver sizeof( SQLLEN ) == 4
--
Nick Gorham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: nick@lurcher.org
Subject: Re: ODBC : SQLGetData question
In-Reply-To: <53732A14.1000001@lurcher.org>
References: <CALSLE1P5zWBBckGQaOKQzcN-jkR_nn5PSno_b-iRS6cR4H=uvA@mail.gmail.com> <53730FFB.5020304@gmail.com> <CALSLE1MLEDoi4aoEQdE093yJBJygATTFWYhTvgAqhsEDYvJ0Uw@mail.gmail.com> <CALSLE1MSthQPLGdKDPC9cTozFSqWDzBeZtz6VnavY-Xjik6fGw@mail.gmail.com> <53732A14.1000001@lurcher.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox