X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3792AD1F0B5 for ; Tue, 4 May 2004 10:36:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 62785-02 for ; Tue, 4 May 2004 10:35:53 -0300 (ADT) Received: from relay3.mail2web.com (relay3.mail2web.com [168.144.1.83]) by svr1.postgresql.org (Postfix) with ESMTP id 8FCF7D1CAB0 for ; Tue, 4 May 2004 10:35:28 -0300 (ADT) Received: from M2W046.mail2web.com ([168.144.251.152]) by relay3.mail2web.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 4 May 2004 09:35:31 -0400 Message-ID: <63340-22004524133531385@M2W046.mail2web.com> X-Priority: 3 Reply-To: ashok@kalculate.com X-Originating-IP: 61.16.132.195 X-URL: http://mail2web.com/ From: "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 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 04 May 2004 13:35:31.0579 (UTC) FILETIME=[ABA96CB0:01C431DC] X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.8 tagged_above=0.0 required=5.0 tests=PRIORITY_NO_NAME X-Spam-Level: X-Archive-Number: 200405/31 X-Sequence-Number: 17745 hi=20 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=20 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/ .