Re: ODBC : SQLGetData question

From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: aihtdikh(at)gmail(dot)com
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: ODBC : SQLGetData question
Date: 2014-05-14 07:21:44
Message-ID: CALSLE1MLEDoi4aoEQdE093yJBJygATTFWYhTvgAqhsEDYvJ0Uw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On Wed, May 14, 2014 at 12:10 PM, aihtdikh <aihtdikh(at)gmail(dot)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...

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Dev Kumkar 2014-05-14 07:46:59 Re: ODBC : SQLGetData question
Previous Message aihtdikh 2014-05-14 06:40:59 Re: ODBC : SQLGetData question