From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Han <zhouhanok@vip.sina.com>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Problem about Bytea and SQL_C_CHAR
Date: Wed, 27 Nov 2002 19:03:09 +0900
Message-ID: <3DE4985D.AF0A81E6@tpf.co.jp> (raw)
References: <20021127061918.756184760EF@postgresql.org>
Please try the snapshot dll at http://w2422.nsk.ne.jp/~inoue/ .
regards,
Hiroshi Inoue
http://w2422.nsk.ne.jp/~inoue/
Han wrote:
>
> Hi,
> Here is the code:
>
> strcpy(data, "FF");
> cb = 2;
> rc = SQLBindParameter(hstmt, i,
> SQL_PARAM_INPUT,
> SQL_C_CHAR,
> SQL_VARBINARY,
> precision, scale,
> &data, MAX_STRING_SIZE,
> &cb);
> rc = SQLPrepare(hstmt, "insert into test(ColBytea) values(?)",
> SQL_NTS);
> rc = SQLExecute(hstmt);
>
> After this, the value inserted in column ColByteatable
> (datatype is bytea) of table test was a char string 'FF',
> which was expected to be 0xFF(255).
>
> There's no problem with binary column in Ms Sql Server.
> I'm porting my code from sql server to postgresql. So help
> me, please!
>
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: Inoue@tpf.co.jp, zhouhanok@vip.sina.com
Subject: Re: Problem about Bytea and SQL_C_CHAR
In-Reply-To: <3DE4985D.AF0A81E6@tpf.co.jp>
References: <20021127061918.756184760EF@postgresql.org> <3DE4985D.AF0A81E6@tpf.co.jp>
* 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