typecasting numeric(18,4) to varchar/text - Mailing list pgsql-sql

From ashok@kalculate.com
Subject typecasting numeric(18,4) to varchar/text
Date
Msg-id 63340-22004524133531385@M2W046.mail2web.com
Whole thread Raw
Responses Re: typecasting numeric(18,4) to varchar/text  (Andrew Sullivan <ajs@crankycanuck.ca>)
List 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 by date:

Previous
From: "Muhyiddin A.M Hayat"
Date:
Subject: Rank
Next
From: george young
Date:
Subject: Re: Rank