Re: figuring out why I am having this issue

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Joel Fradkin" <jfradkin(at)wazagua(dot)com>
Cc: <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: figuring out why I am having this issue
Date: 2005-09-01 14:49:47
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9DFA@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Joel Fradkin [mailto:jfradkin(at)wazagua(dot)com]
> Sent: 01 September 2005 15:43
> To: Dave Page
> Cc: pgsql-odbc(at)postgresql(dot)org
> Subject: RE: [ODBC] figuring out why I am having this issue
>
> I would like to look at this code, but searching the source I
> am not even
> seeing it?
>
> char szData[max_longvarchar_size];
> char szChunk[1024];
>
> // Get the data in chunks
> do
> {
> retcode = SQLGetData(hStmt, 1, SQL_C_CHAR, szChunk,
> sizeof(szChunk), &cbData);
> strcat(szData, szChunk);
>
> } while (retcode != SQL_SUCCESS && retcode != SQL_NO_DATA);
>
> Maybe I am too out of touch with C to be any help, but I
> should at a minimum
> be able to see the code you are referenceing?

:-)

You won't find that in the source - it's an example to show what your
app (or MS ADO or similar) might be doing wrong. If the actual data
being read in the SQLGetData call is larger than max_longvarchar_size,
it'll overflow szData.

I guess one answer might be to cap the size reported by SQLGetData to
whatever the column size is, but I'm pretty sure that will likely break
things for other people (though it should be fixable by tweaking
maxlongvarcharsize).

Regards, Dave.

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Joel Fradkin 2005-09-01 14:59:58 Re: figuring out why I am having this issue
Previous Message Joel Fradkin 2005-09-01 14:42:51 Re: figuring out why I am having this issue