Re: Cast Type

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


В списке pgsql-general по дате отправления:

Предыдущее
От: Lee Kindness
Дата:
Сообщение: Re: how to count string occurrence in column
Следующее
От: "Jules Alberts"
Дата:
Сообщение: Re: how to count string occurrence in column