Skip site navigation (1) Skip section navigation (2)

Re: Problem about Bytea and SQL_C_CHAR

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Han <zhouhanok(at)vip(dot)sina(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Problem about Bytea and SQL_C_CHAR
Date: 2002-11-27 10:03:09
Message-ID: 3DE4985D.AF0A81E6@tpf.co.jp (view raw or flat)
Thread:
Lists: pgsql-odbc
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!
>

In response to

pgsql-odbc by date

Next:From: Dave PageDate: 2002-11-27 10:23:36
Subject: Re: ODBC changes
Previous:From: Henshall, Stuart - Design & PrintDate: 2002-11-27 09:56:05
Subject: Re: inserting blob data

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group