Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TB51Q-0006Of-E6 for pgsql-odbc@postgresql.org; Mon, 10 Sep 2012 14:31:32 +0000 Received: from winpg.jp ([219.94.251.195]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TB51J-0003la-M6 for pgsql-odbc@postgresql.org; Mon, 10 Sep 2012 14:31:32 +0000 Received: from [192.168.202.2] (p6122-ipad307funabasi.chiba.ocn.ne.jp [123.217.184.122]) by winpg.jp (Postfix) with ESMTPA id 0EA06B24112; Mon, 10 Sep 2012 23:28:10 +0900 (JST) Message-ID: <504DF9BF.3030602@winpg.jp> Date: Mon, 10 Sep 2012 23:31:27 +0900 From: Hiroshi Saito User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ja; rv:1.9.2.25) Gecko/20111213 Thunderbird/3.1.17 MIME-Version: 1.0 To: ranjeeth kumar CC: "pgsql-odbc@postgresql.org" Subject: Re: Regarding PostgreSQL BIT datatype binding in ODBC....... References: <1343892323.97562.YahooMailNeo@web190004.mail.sg3.yahoo.com> <1347251524.26745.YahooMailNeo@web190003.mail.sg3.yahoo.com> In-Reply-To: <1347251524.26745.YahooMailNeo@web190003.mail.sg3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201209/12 X-Sequence-Number: 10951 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.