From: ashok@kalculate.com <ashok@kalculate.com>
To: pgsql-sql@postgresql.org
Subject: typecasting numeric(18,4) to varchar/text
Date: Tue, 4 May 2004 09:35:31 -0400
Message-ID: <63340-22004524133531385@M2W046.mail2web.com> (raw)
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/ .
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: ashok@kalculate.com
Subject: Re: typecasting numeric(18,4) to varchar/text
In-Reply-To: <63340-22004524133531385@M2W046.mail2web.com>
* 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