Urgent help in bit_string data type

Поиск
Список
Период
Сортировка
От Karthikeyan Sundaram
Тема Urgent help in bit_string data type
Дата
Msg-id BAY131-W10EF789544B96131E8A482B05F0@phx.gbl
обсуждение исходный текст
Ответы Re: [SQL] Urgent help in bit_string data type
Список pgsql-admin

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 text
HINT:  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.

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Chris Hoover"
Дата:
Сообщение: Where are aliases stored?
Следующее
От: "Chris Hoover"
Дата:
Сообщение: Re: Best compressed archive_command on Linux?