Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TAvfR-0004ZR-2e for pgsql-odbc@postgresql.org; Mon, 10 Sep 2012 04:32:13 +0000 Received: from nm28-vm7.bullet.mail.sg3.yahoo.com ([106.10.151.150]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TAvfM-00033D-DV for pgsql-odbc@postgresql.org; Mon, 10 Sep 2012 04:32:11 +0000 Received: from [106.10.166.62] by nm28.bullet.mail.sg3.yahoo.com with NNFMP; 10 Sep 2012 04:32:05 -0000 Received: from [106.10.150.26] by tm19.bullet.mail.sg3.yahoo.com with NNFMP; 10 Sep 2012 04:32:05 -0000 Received: from [127.0.0.1] by omp1027.mail.sg3.yahoo.com with NNFMP; 10 Sep 2012 04:32:05 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 138623.86879.bm@omp1027.mail.sg3.yahoo.com Received: (qmail 40664 invoked by uid 60001); 10 Sep 2012 04:32:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1347251524; bh=lMAg6A3aCe5T7Zn9bck6rt/tnUs/aSV1oH3nm3chGig=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=hIo7h+zAT+bYwuZK8p7mzGsxZyoopzWj+Lm7SXxPUEoAMiQDllgIjG9GwuVaPE8cdmo4vb6xVzs3BEQf+hffOHKPdzUCm1mNIIOqMm5Lex03HlmbhRiNtD9nPfaE/Jb9sfsClAMr2xFY+wUSx3Ls1t0GUTzn4+Aw+HnfhaKQmFw= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=ueiPg1ZD5rjMDvvqUdlwOXHlbXUnFxoG3l0Mkk5utOHBCtviT0e2FnofHTfg3DfIg6Jl/Hip1dLo/T/+dGzjvtmrO7Cg+LyEoYxYo5oj1ykxZFG3Hvi2cleNpf1r1Xli3xxFVBOMxoqs+ZN4R1KYUXH/TPtS+JFK2549toAtx5g=; X-YMail-OSG: r.FLrhUVM1mSdvfHbznGUybCNQCb_wyeTRaccX60cKiJfD6 VVOJc8qO6ZVoskJDrpFl92nw5ArPewHYS9Y9cUnKgFlOMkxnUl_EkKSDvuvS jp_v5HCTd87iIBumWKKmHNBFyWUyZ07Ii5tKwexX2_UTr5xDimX5Zz4Gw6bi FUoNVMrusKNovoUozDEm1K7eu73wWS013K3ucqUvHJ.9rZu0baQ97b1FV0Of qq2dBV6WB973pqFqsaC6jKHmxOe6ECRyNSBUCOjNRhmq1TJoaxETvpdJqx0f jRxgUu8nspPLk4nOTU_sI8TPH7ZobHCXzMcAgsyAQx_qXCyh0PNSUXBQZ0c7 ZrL4oMMjQG5BWK3wxuhTppGN9e6yFl0P51Gx7F8_Zs77l.5Nc7Oh24mHMWo1 0XZbjXvXMXPossHx48bMF_CXQKDl_jeIC9omAx7pcjsUjxAiPsbNNgwZoe0F W0uqu95lELPcTFFJZKilDFyVV Received: from [124.123.213.178] by web190003.mail.sg3.yahoo.com via HTTP; Mon, 10 Sep 2012 12:32:04 SGT X-Mailer: YahooMailWebService/0.8.121.416 References: <1343892323.97562.YahooMailNeo@web190004.mail.sg3.yahoo.com> Message-ID: <1347251524.26745.YahooMailNeo@web190003.mail.sg3.yahoo.com> Date: Mon, 10 Sep 2012 12:32:04 +0800 (SGT) From: ranjeeth kumar Reply-To: ranjeeth kumar Subject: Re: Regarding PostgreSQL BIT datatype binding in ODBC....... To: "pgsql-odbc@postgresql.org" In-Reply-To: <1343892323.97562.YahooMailNeo@web190004.mail.sg3.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1901673337-1630460026-1347251524=:26745" X-Pg-Spam-Score: 0.7 (/) X-Archive-Number: 201209/9 X-Sequence-Number: 10948 ---1901673337-1630460026-1347251524=:26745 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello All,=0A=0AI have a table with a bit(10) type colmn. I can insert "101= 0110110" into that column from PSQL. =0Ai.e.,=0Apostgres=3D# insert into pu= blic.ranc2b values(1,'1101010101');=0AINSERT 0 1=0A=0AI want to insert the = same character data "1010110110" into the same bit(10) typed column from an= ODBC application program, =0ACan somebody please suggest me how should I b= ind the data in the SQLBindParameter call.=0A=0AI tried to bind the data as= SQL_BINARY and SQL_CHAR but I got Incorrect binary data format error.=0A= =0AQuick help is appreciated.=0A=0AThanks in Advance.=0A=0ARegards,=0ARanje= eth.=0A=0A=0A=0A=0A=0A=0A=0A________________________________=0A From: ranje= eth kumar =0ATo: "pgsql-odbc@postgresql.org" =0ASent: Thursday, 2 August 2012 12:55 PM=0ASubjec= t: Regarding PostgreSQL BIT datatype binding in ODBC.......=0A =0A=0AHello = All,=0A=0AI am new to this mailing list and this is my first post :)=0A=0A= =0AI want to pass numeric data (2345) into a PostgreSQL BIT datatype column= bit(1) using dynamic sql thru ODBC. I very much understand the risk of dat= a getting truncated...=0AOn PSQL, I simply can do -- insert into tab values= (CAST(2345 AS BIT(1))) to acheive what i want (and I understand only 1 woul= d get inserted). But I want to do this through ODBC and dynamic sql.=0A=0AI= will have to prepare my query as=A0=0A=0Ainsert into tab values(CAST(? AS = bit(1));=0A=0Athen bind 2345 and then execute the statement.=A0=0A=0ACan so= meone help me on how the binding should happen...=A0=0AI mean wat should be= the "ValueType" and the "ParameterType" etc. in the call to the SQLBindPar= ameter function....=0A=0ASQLRETURN SQLBindParameter(=0A=A0 =A0 =A0 SQLHSTMT= =A0 =A0 =A0 =A0StatementHandle,=0A=A0 =A0 =A0 SQLUSMALLINT =A0 =A0Paramete= rNumber,=0A=A0 =A0 =A0 SQLSMALLINT =A0 =A0 InputOutputType,=0A=A0 =A0 =A0 S= QLSMALLINT =A0 =A0 ValueType,=0A=A0 =A0 =A0 SQLSMALLINT =A0 =A0 ParameterTy= pe,=0A=A0 =A0 =A0 SQLULEN =A0 =A0 =A0 =A0 ColumnSize,=0A=A0 =A0 =A0 SQLSMAL= LINT =A0 =A0 DecimalDigits,=0A=A0 =A0 =A0 SQLPOINTER =A0 =A0 =A0ParameterVa= luePtr,=0A=A0 =A0 =A0 SQLLEN =A0 =A0 =A0 =A0 =A0BufferLength,=0A=A0 =A0 =A0= SQLLEN * =A0 =A0 =A0 =A0StrLen_or_IndPtr);=0A=0A=0AQuick help is appreciat= ed and additional inputs/coments are also most welcome...=0A=0A=0A=0AThanks= and Regards,=0ARanjeeth.=A0 ---1901673337-1630460026-1347251524=:26745 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hello All,

I h= ave a table with a bit(10) type colmn. I can insert "1010110110" into that = column from PSQL.
i.e.,
postgres=3D# insert into public.ranc2b value= s(1,'1101010101');
INSERT 0 1

I want to insert the same character= data "1010110110" into the same bit(10) typed column from an ODBC applicat= ion 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 he= lp is appreciated.

Thanks in Advance.

Regards,
Ranjeeth.





From: ranjeeth kumar <ranjeeth_cool@yahoo.co.in&= gt;
To: "pgsql-odbc@po= stgresql.org" <pgsql-odbc@postgresql.org>
Sent: Thursday, 2 August 2012 12:55 PM
Subject: Regarding PostgreSQL B= IT datatype binding in ODBC.......

Hello All,

= I = am new to this mailing list and this is my first post :)

I want to pass numeric = data (2345) into a PostgreSQL BIT datatype column bit(1) using dynamic sql = thru ODBC. I very much understand the risk of data getting truncated...
On PSQ= L, I simply can do -- insert into tab values(CAST(2345 AS BIT(1))) to achei= ve what i want (and I understand only 1 would get inserted). But I want=0A = to do this through ODBC and dynamic sql.

I will have to prepare my query as&= nbsp;

insert into tab values(CAST(? AS bit(1));

then bind 2345 and then exec= ute the statement. 

Can someone help me on how the binding should happe= n... 
I mean wat should be the "ValueType" and the "ParameterType" etc. i= n the call=0A to the SQLBindParameter function....

SQLRETURN SQLBindParamete= r(
=       SQLHSTMT        StatementHandle,
&nbs= p;     SQLUSMALLINT    ParameterNumber,
    &nbs= p; SQLSMALLINT     InputOutputType,
      SQLSMALLI= NT     ValueType,
      SQLSMALLINT     Par= ameterType,
   =0A   SQLULEN         Column= Size,
      SQLSMALLINT     DecimalDigits,
   =   SQLPOINTER      ParameterValuePtr,
=      = SQLLEN          BufferLength,
      S= QLLEN *        StrLen_or_IndPtr);


= Quick help is apprec= iated and additional inputs/coments are also most welcome...


<= /div>

Thanks a= nd Regards,
Ranjeeth. 


---1901673337-1630460026-1347251524=:26745--