pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ranjeeth kumar <ranjeeth_cool@yahoo.co.in>
To: Hiroshi Saito <hiroshi@winpg.jp>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Regarding PostgreSQL BIT datatype binding in ODBC.......
Date: Mon, 10 Sep 2012 23:17:45 +0800 (SGT)
Message-ID: <1347290265.7494.YahooMailNeo@web190001.mail.sg3.yahoo.com> (raw)
In-Reply-To: <504DF9BF.3030602@winpg.jp>
References: <1343892323.97562.YahooMailNeo@web190004.mail.sg3.yahoo.com>
	<1347251524.26745.YahooMailNeo@web190003.mail.sg3.yahoo.com>
	<504DF9BF.3030602@winpg.jp>

Hello Saito,

Thanks a lot for your response.
I tried using SQL_C_TCHAR and SQL_CHAR as you suggested but I still get the same "Incorrect binary data format in bind parameter" error.

I am not sure if I am missing something here...


Thanks and Regards,
Ranjeeth.



________________________________
 From: Hiroshi Saito <hiroshi@winpg.jp>
To: ranjeeth kumar <ranjeeth_cool@yahoo.co.in> 
Cc: "pgsql-odbc@postgresql.org" <pgsql-odbc@postgresql.org> 
Sent: Monday, 10 September 2012 8:01 PM
Subject: Re: [ODBC] Regarding PostgreSQL BIT datatype binding in ODBC.......
 
Hi.

Is this helpful to you?
one example)
== odbc
SQLTCHAR kd[100];
strcpy(kd, "1101010101");
...
SQLPrepare(hstmt, "INSERT INTO bbb VALUES (?)", SQL_NTS);
SQLBindParameter(hstmt, (SQLUSMALLINT)1, SQL_PARAM_INPUT,
    SQL_C_TCHAR, SQL_CHAR, 0, 0, &kd[0], 100, &len);
== psql
postgres=# select * from bbb;
     key
------------
  1101010101

Regards,
Hiroshi Saito

(2012/09/10 13:32), ranjeeth kumar wrote:
> Hello All,
>
> I have a table with a bit(10) type colmn. I can insert "1010110110" into
> that column from PSQL.
> i.e.,
> postgres=# insert into public.ranc2b values(1,'1101010101');
> INSERT 0 1
>
> I want to insert the same character data "1010110110" into the same
> bit(10) typed column from an ODBC application program,
> Can somebody please suggest me how should I bind the data in the
> SQLBindParameter call.
>
> I tried to bind the data as SQL_BINARY and SQL_CHAR but I got Incorrect
> binary data format error.
>
> Quick help is appreciated.
>
> Thanks in Advance.
>
> Regards,
> Ranjeeth.

view thread (6+ messages)  latest in thread

Message-ID: <1347290265.7494.YahooMailNeo@web190001.mail.sg3.yahoo.com>
Permalink:  ../1347290265.7494.YahooMailNeo@web190001.mail.sg3.yahoo.com/
Also on:    postgresql.org/message-id/1347290265.7494.YahooMailNeo@web190001.mail.sg3.yahoo.com

 · 

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: ranjeeth_cool@yahoo.co.in, hiroshi@winpg.jp
  Subject: Re: Regarding PostgreSQL BIT datatype binding in ODBC.......
  In-Reply-To: <1347290265.7494.YahooMailNeo@web190001.mail.sg3.yahoo.com>
  References: <1343892323.97562.YahooMailNeo@web190004.mail.sg3.yahoo.com> <1347251524.26745.YahooMailNeo@web190003.mail.sg3.yahoo.com> <504DF9BF.3030602@winpg.jp> <1347290265.7494.YahooMailNeo@web190001.mail.sg3.yahoo.com>

* 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