pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karthikeyan Sundaram <skarthi98@hotmail.com>
To: pgsql-admin@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Urgent help in bit_string data type
Date: Wed, 11 Apr 2007 13:30:57 -0700
Message-ID: <BAY131-W10EF789544B96131E8A482B05F0@phx.gbl> (raw)




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
==========================
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 textHINT:  You will need to rewrite or cast the expression.
 
Please help me
 
regards
skarthi
 
_________________________________________________________________
i'm making a difference. Make every IM count for the cause of your choice. Join Now.
http://clk.atdmt.com/MSN/go/msnnkwme0080000001msn/direct/01/?href=http://im.live.com/messenger/im/ho...

view thread (6+ messages)  latest in thread

Message-ID: <BAY131-W10EF789544B96131E8A482B05F0@phx.gbl>
Permalink:  ../BAY131-W10EF789544B96131E8A482B05F0@phx.gbl/
Also on:    postgresql.org/message-id/BAY131-W10EF789544B96131E8A482B05F0@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: skarthi98@hotmail.com, pgsql-admin@postgresql.org
  Subject: Re: Urgent help in bit_string data type
  In-Reply-To: <BAY131-W10EF789544B96131E8A482B05F0@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox