Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id CF6EF1B454A5 for ; Thu, 2 Aug 2012 04:25:42 -0300 (ADT) Received: from nm27-vm5.bullet.mail.sg3.yahoo.com ([106.10.151.132]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Swpms-0005Bd-N6 for pgsql-odbc@postgresql.org; Thu, 02 Aug 2012 07:25:41 +0000 Received: from [106.10.166.119] by nm27.bullet.mail.sg3.yahoo.com with NNFMP; 02 Aug 2012 07:25:23 -0000 Received: from [106.10.151.186] by tm8.bullet.mail.sg3.yahoo.com with NNFMP; 02 Aug 2012 07:25:23 -0000 Received: from [127.0.0.1] by omp1012.mail.sg3.yahoo.com with NNFMP; 02 Aug 2012 07:25:23 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 897371.76807.bm@omp1012.mail.sg3.yahoo.com Received: (qmail 18284 invoked by uid 60001); 2 Aug 2012 07:25:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1343892323; bh=jL5mGLqcDI13mk+CVUsc8buj06+a0aA1PdPvkOehZko=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=TRrP8/wLA19P7CppZa46l2FRtnMguatVE5n2RIinfQLaE1X5T2YgCUeGUvTkI1ibXyfEdKq+LrbxgU9Ja2Zvo2y5WyV0So4sCZ2mg07yzfECOApWdmxMP0XeWdZoQDbA1Q8orKs2x3war1Q4UTRrZ9OVtHnDuylMj3f3Pw0TUvY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=4qX20queXsbxbZGR3fnc9kHOU+npLy1iW8nw0R1TsXDLQTM8bOCDGQrNGNDcjNJRYb8JaGK5+1JsLj3om9CC2o/4DCpwFeyR46lxPG8Wc7yWcCp4O0AyFUUXhjoZ2tp032+kJzGOD3E1kQaHxS7AJSm2ArWoJoGiKsx7eTyDeRQ=; X-YMail-OSG: PuzveBYVM1k58YIG28QDEJjQZN7cnxgRNdI2bJySlzFiVt6 ld5c2Wa70ynjU5sClTG_rPc56idMeCwvAFHcp8Bzv4JYAWCnkwkrGJWHB5hw RoVIbh5ZZrUfuQuPDveAo_llXmb1DOi5WuQ89_qN6tr76qoZ0.9T5gCn7vXZ PQHDCUfpkM6xZjBClh2f7e7e5wh6ByFXgXwWBlJrXXSfZ2MNKXhLQS7wNcd3 8VZn4xnxQQiwtVqfOO2_.1D4z.0iEEMJS.jE0L7oOwIOoaRyrmO7lGGpo4C_ fchRkE9jQCoLpWqEPqBNxY3O9YjXhfuQcJxAi5WVgkSUEQg.7QgtCvspwZgF EqkgtYovKyCtaRhKzokLE.Htj9T.oZ2LGrowd7k57Op1XcLhHK6U0mK1a88n obXmhiBk75d7ScAUj3Hgr4yMb9HxVPrvKmuBqa0og6orkzyAcYikDp54- Received: from [196.15.16.108] by web190004.mail.sg3.yahoo.com via HTTP; Thu, 02 Aug 2012 15:25:23 SGT X-Mailer: YahooMailWebService/0.8.120.356233 Message-ID: <1343892323.97562.YahooMailNeo@web190004.mail.sg3.yahoo.com> Date: Thu, 2 Aug 2012 15:25:23 +0800 (SGT) From: ranjeeth kumar Reply-To: ranjeeth kumar Subject: Regarding PostgreSQL BIT datatype binding in ODBC....... To: "pgsql-odbc@postgresql.org" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-657894450-20561280-1343892323=:97562" X-Pg-Spam-Score: -0.1 (/) X-Archive-Number: 201208/1 X-Sequence-Number: 10910 ---657894450-20561280-1343892323=:97562 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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 bi= t(1) using dynamic sql thru ODBC. I very much understand the risk of data g= etting truncated... On PSQL, I simply can do -- insert into tab values(CAST(2345 AS BIT(1))) to= acheive what i want (and I understand only 1 would get inserted). But I wa= nt to do this through ODBC and dynamic sql. I will have to prepare my query as=A0 insert into tab values(CAST(? AS bit(1)); then bind 2345 and then execute the statement.=A0 Can someone help me on how the binding should happen...=A0 I mean wat should be the "ValueType" and the "ParameterType" etc. in the ca= ll to the SQLBindParameter function.... SQLRETURN SQLBindParameter( =A0 =A0 =A0 SQLHSTMT =A0 =A0 =A0 =A0StatementHandle, =A0 =A0 =A0 SQLUSMALLINT =A0 =A0ParameterNumber, =A0 =A0 =A0 SQLSMALLINT =A0 =A0 InputOutputType, =A0 =A0 =A0 SQLSMALLINT =A0 =A0 ValueType, =A0 =A0 =A0 SQLSMALLINT =A0 =A0 ParameterType, =A0 =A0 =A0 SQLULEN =A0 =A0 =A0 =A0 ColumnSize, =A0 =A0 =A0 SQLSMALLINT =A0 =A0 DecimalDigits, =A0 =A0 =A0 SQLPOINTER =A0 =A0 =A0ParameterValuePtr, =A0 =A0 =A0 SQLLEN =A0 =A0 =A0 =A0 =A0BufferLength, =A0 =A0 =A0 SQLLEN * =A0 =A0 =A0 =A0StrLen_or_IndPtr); Quick help is appreciated and additional inputs/coments are also most welco= me... Thanks and Regards, Ranjeeth.=A0= ---657894450-20561280-1343892323=:97562 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hello All,

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

I want to pas= s numeric data (2345) into a PostgreSQL BIT datatype column bit(1) using dy= namic sql thru ODBC. I very much understand the risk of data getting trunca= ted...
On PSQL, I simply can do -- insert into tab values(CAST(2345 AS BIT(1))= ) to acheive what i want (and I understand only 1 would get inserted). But = I want to do this through ODBC and dynamic sql.

I will have to prepare my query as=  

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 to the SQLBindParameter function....

SQLRETURN SQLBindParameter(
   =   SQLHSTMT        StatementHandle,
    &nb= sp; SQLUSMALLINT    ParameterNumber,
      SQLSMALLI= NT     InputOutputType,
      SQLSMALLINT   &nbs= p; ValueType,
      SQLSMALLINT     ParameterType,
 = ;     SQLULEN         ColumnSize,
      S= QLSMALLINT     DecimalDigits,
      SQLPOINTER  =    ParameterValuePtr,
      SQLLEN     &nb= sp;    BufferLength,
      SQLLEN *     &nb= sp;  StrLen_or_IndPtr);


Quick help is appreciated and additional inpu= ts/coments are also most welcome...



Thanks and Regards,
Ranjeeth. 
= ---657894450-20561280-1343892323=:97562--