Cast Type - Mailing list pgsql-general

From Thirumoorthy Bhuvneswari
Subject Cast Type
Date
Msg-id 20020827091029.94869.qmail@web13603.mail.yahoo.com
Whole thread Raw
List pgsql-general
hi,
I am using Postgresql-7.1 on RedHat Linux-7.1. I would
like to know about cast types. I am having a tableA
with two fields cr_amt varchar(15) and dr_amt
varchar(15). I am having about 10000 records so I
could not recreate it. I am having tableB with cr_amt
float8 and dr_amt float8. I want to use 'sum' function
from the tableB.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'. How could I
achieve this. Please help me. thanks.

regards,
T.Bhuvaneswari.

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

pgsql-general by date:

Previous
From: "Ben-Nes Michael"
Date:
Subject: how to count string occurrence in column
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: how to count string occurrence in column