Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E2ECB474E53 for ; Wed, 27 Nov 2002 05:01:34 -0500 (EST) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 4273F474E42 for ; Wed, 27 Nov 2002 05:01:33 -0500 (EST) Received: (qmail 14629 invoked from network); 27 Nov 2002 10:01:34 -0000 Received: from unknown (HELO tpf.co.jp) (126.0.1.60) by sd2.tpf-fw-c.co.jp with SMTP; 27 Nov 2002 10:01:34 -0000 Message-ID: <3DE4985D.AF0A81E6@tpf.co.jp> Date: Wed, 27 Nov 2002 19:03:09 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: Han Cc: "pgsql-odbc@postgresql.org" Subject: Re: Problem about Bytea and SQL_C_CHAR References: <20021127061918.756184760EF@postgresql.org> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/166 X-Sequence-Number: 2343 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! >