Re: Cast Type

Поиск
Список
Период
Сортировка
Искать
От
Peter Gibbs
Тема
Re: Cast Type
Дата
Msg-id
000d01c24dae$0ba7f4c0$0b01010a@emkel.co.za
Список
Дерево обсуждения
Cast Type Thirumoorthy Bhuvneswari <tbhuvneswari@yahoo.com>
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

В списке pgsql-general по дате отправления
От: Lee Kindness
Дата:
От: Jules Alberts
Дата:
FAQ