Re: figuring out why I am having this issue - Mailing list pgsql-odbc

From Dave Page
Subject Re: figuring out why I am having this issue
Date
Msg-id E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9DFA@ratbert.vale-housing.co.uk
Whole thread Raw
In response to figuring out why I am having this issue  ("Joel Fradkin" <jfradkin@wazagua.com>)
Responses Re: figuring out why I am having this issue  ("Joel Fradkin" <jfradkin@wazagua.com>)
List pgsql-odbc

> -----Original Message-----
> From: Joel Fradkin [mailto:jfradkin@wazagua.com]
> Sent: 01 September 2005 15:43
> To: Dave Page
> Cc: pgsql-odbc@postgresql.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.

pgsql-odbc by date:

Previous
From: "Joel Fradkin"
Date:
Subject: Re: figuring out why I am having this issue
Next
From: "Joel Fradkin"
Date:
Subject: Re: figuring out why I am having this issue