From: Clemens Ladisch <clemens@ladisch.de>
To: pgsql-odbc@lists.postgresql.org
Subject: Re: What is the problem with this code?
Date: Fri, 19 Oct 2018 09:04:31 +0200
Message-ID: <33da99f0-c583-6a0f-65f7-12873df6e632@ladisch.de> (raw)
In-Reply-To: <CA+FnnTyfwr3Q+=AWAN--w8DyQxEuyFkjtBoWxakDtMN=5kCS1A@mail.gmail.com>
References: <CA+FnnTyfwr3Q+=AWAN--w8DyQxEuyFkjtBoWxakDtMN=5kCS1A@mail.gmail.com>
Igor Korot wrote:
> SQLWCHAR *qry1 = new SQLWCHAR[query1.length() + 2];
> memset( qry1, '\0', query1.length() + 2 );
memset expects the length to be in bytes.
> ret = SQLPrepare( m_hstmt, qry1, SQL_NTS );
> ret = SQLDescribeCol( m_hstmt, 1, columnName, 256, &columnNameLen, &columnDataType, &columnDataSize, &columnDataDigits, &columnDataNullable );
>
> The SQLDescribeCol() call fails with the error invalid column number".
Does SQLExecute work? Does SQLNumResultCols give 1?
The specification says "for performance reasons, an application should
not call SQLDescribeCol before executing a statement." But it should
work anyway; if not, this would be a bug. What are the settings of
"Parse Statements" and "Server side prepare" of the data source?
Regards,
Clemens
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-general@postgresql.org
Cc: clemens@ladisch.de, pgsql-odbc@lists.postgresql.org
Subject: Re: What is the problem with this code?
In-Reply-To: <33da99f0-c583-6a0f-65f7-12873df6e632@ladisch.de>
References: <CA+FnnTyfwr3Q+=AWAN--w8DyQxEuyFkjtBoWxakDtMN=5kCS1A@mail.gmail.com> <33da99f0-c583-6a0f-65f7-12873df6e632@ladisch.de>
* 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