typecasting numeric(18,4) to varchar/text

Поиск
Список
Период
Сортировка
От ashok@kalculate.com
Тема typecasting numeric(18,4) to varchar/text
Дата
Msg-id 63340-22004524133531385@M2W046.mail2web.com
обсуждение исходный текст
Ответы Re: typecasting numeric(18,4) to varchar/text
Список pgsql-sql
hi
how can i typecast a numeric(18,4) value (that i'm extracting from a table)
into a a varchar (which i'll be inserting into another table)
that is:

create table a (a numeric(18,4));
create table b (b varchar(25));
insert into a values(12000.43);
insert into b select (a.a)::varchar;


the above gives the followig error

ERROR:  Cannot cast type 'numeric' to 'character varying'

alternately try (this is my real requirement)

insert into b select 'ID'||((a.a)::varchar);

there has been no results on google

thanks in advance
ashok

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




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

Предыдущее
От: "Muhyiddin A.M Hayat"
Дата:
Сообщение: Rank
Следующее
От: george young
Дата:
Сообщение: Re: Rank