pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Han <zhouhanok@vip.sina.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Problem about Bytea and SQL_C_CHAR
Date: Wed, 27 Nov 2002 14:19:37 +0800
Message-ID: <20021127061918.756184760EF@postgresql.org> (raw)

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!

    Regards!

        
 				

        Han
        zhouhanok@vip.sina.com
          2002-11-27






view thread (8+ messages)  latest in thread

Message-ID: <20021127061918.756184760EF@postgresql.org>
Permalink:  ../20021127061918.756184760EF@postgresql.org/
Also on:    postgresql.org/message-id/20021127061918.756184760EF@postgresql.org

 · 

reply

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: zhouhanok@vip.sina.com
  Subject: Re: Problem about Bytea and SQL_C_CHAR
  In-Reply-To: <20021127061918.756184760EF@postgresql.org>
  References: <20021127061918.756184760EF@postgresql.org>

* 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