Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 4902F9FB688; Wed, 11 Apr 2007 17:31:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 71054-04; Wed, 11 Apr 2007 17:30:55 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc3-s27.bay0.hotmail.com (bay0-omc3-s27.bay0.hotmail.com [65.54.246.227]) by postgresql.org (Postfix) with ESMTP id 738499FB59A; Wed, 11 Apr 2007 17:30:58 -0300 (ADT) Received: from BAY131-W10 ([65.55.136.45]) by bay0-omc3-s27.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Wed, 11 Apr 2007 13:30:57 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_212de693-e805-4486-9f36-dab2ab602055_" X-Originating-IP: [67.116.31.14] From: Karthikeyan Sundaram To: , Subject: Urgent help in bit_string data type Date: Wed, 11 Apr 2007 13:30:57 -0700 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 11 Apr 2007 20:30:57.0005 (UTC) FILETIME=[4F3399D0:01C77C78] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.948 tagged_above=0 required=5 tests=AWL=-1.272, BAYES_40=-0.185, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, HTML_40_50=0.496, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200704/102 X-Sequence-Number: 25166 --_212de693-e805-4486-9f36-dab2ab602055_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Gurus, =20 I have a table with datatype as bitstrings =20 =20 create table test_a (b bit(3)); =20 insert into test_a values ('111'); This will convert a bit to a number =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D select to_number((substring(b,1,1)::int),9)+3 from test_a; How will I convert a Number to a bit ---------------------------------- =20 insert into test_a values (to_char(1,'9')); =20 ERROR: column "b" is of type bit but expression is of type textHINT: You = will need to rewrite or cast the expression. =20 Please help me =20 regards skarthi =20 _________________________________________________________________ i'm making a difference.=A0Make every IM count for the cause of your choice= . Join Now. http://clk.atdmt.com/MSN/go/msnnkwme0080000001msn/direct/01/?href=3Dhttp://= im.live.com/messenger/im/home/?source=3Dwlmailtagline= --_212de693-e805-4486-9f36-dab2ab602055_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Gurus,
 
   I have a table with datatype as bitstrings
 
 
create table test_a (b bit(3));
 
insert into test_a values ('111');

This will convert a bit to a number
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D
select to_number((substring(b,1,1)::int),9)+3 from test_a;

How will I convert a Number to a bit
----------------------------------
 
insert into test_a values (to_char(1,'9'));
 
ERROR:  column "b" is of type bit but expression is of type text
HI= NT:  You will need to rewrite or cast the expression.
 
Please help me
 
regards
skarthi
 


i'm making a difference.=A0Make every IM= count for the cause of your choice. Join Now. = --_212de693-e805-4486-9f36-dab2ab602055_--