From: | "Peter Gibbs" <peter(at)emkel(dot)co(dot)za> |
---|---|
To: | "Thirumoorthy Bhuvneswari" <tbhuvneswari(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Cast Type |
Date: | 2002-08-27 09:42:22 |
Message-ID: | 000d01c24dae$0ba7f4c0$0b01010a@emkel.co.za |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thirumoorthy Bhuvneswari wrote:
> I gave the query as the follows:
> 'insert into tableB select
> (cr_amt::float8),(dr_amt::float8) from tableA;'
> It comes with the error,
> 'Cannot cast type 'varchar' to 'float8'.
There is no function defined as converting directly from
varchar to float8. If you are going to be doing this a lot
you could create a conversion function, otherwise just do:
insert into tableB
select cr_amt::text::float8, dr_amt::text::float8
from tableA
--
Peter Gibbs
EmKel Systems
From | Date | Subject | |
---|---|---|---|
Next Message | Jules Alberts | 2002-08-27 09:48:40 | Re: how to count string occurrence in column |
Previous Message | Ben-Nes Michael | 2002-08-27 09:38:52 | how to count string occurrence in column |