Re: Regarding PostgreSQL BIT datatype binding in ODBC....... - Mailing list pgsql-odbc

From Hiroshi Saito
Subject Re: Regarding PostgreSQL BIT datatype binding in ODBC.......
Date
Msg-id 504DF9BF.3030602@winpg.jp
Whole thread Raw
In response to Re: Regarding PostgreSQL BIT datatype binding in ODBC.......  (ranjeeth kumar <ranjeeth_cool@yahoo.co.in>)
Responses Re: Regarding PostgreSQL BIT datatype binding in ODBC.......  (ranjeeth kumar <ranjeeth_cool@yahoo.co.in>)
List pgsql-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.


pgsql-odbc by date:

Previous
From: Hiroshi Saito
Date:
Subject: Re: psqlODBC 09.01.0200 Released
Next
From: ranjeeth kumar
Date:
Subject: Re: Regarding PostgreSQL BIT datatype binding in ODBC.......