Char to Int

Поиск
Список
Период
Сортировка
От Rick Seeger
Тема Char to Int
Дата
Msg-id HKEPLMBPEGFGAKDKKAEDMEJFFKAA.rick@nettheory.com
обсуждение исходный текст
Ответ на Re: int1?  (Sean Chittenden <sean@chittenden.org>)
Ответы Re: Char to Int
Список pgsql-general
I'm trying to convert a var char to an int. I tried a couple methods
described in the documentation, but can't seem to get it to work. Any
thoughts?

In this example, the field my_id is character varying(16):

rs=# insert into table2
rs=# select my_Id::INT
rs=# from table1;
ERROR:  Cannot cast type character to integer

rs=#
rs=# insert into table2
rs=# select CASE(my_Id as integer)
rs=# from table1;
ERROR:  Cannot cast type character to integer

Any help or links to appropriate documentation appreciated!

--Rick



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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Virtual Machines and postgres
Следующее
От: "Floyd Shackelford"
Дата:
Сообщение: Table analyzer