Re: Char to Int

Поиск
Список
Период
Сортировка
От Rick Seeger
Тема Re: Char to Int
Дата
Msg-id HKEPLMBPEGFGAKDKKAEDMEJIFKAA.rick@nettheory.com
обсуждение исходный текст
Ответ на Re: Char to Int  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
>
>> Oops, there was a typo in my second example. Still have the problem
>> tho...
>>
>> > rs=#
>> > rs=# insert into table2
>> > rs=# select CAST(my_Id as integer)
>> >             ^^^^
>> > rs=# from table1;
>> > ERROR:  Cannot cast type character to integer
>
> Try the function to_number().
>

rs=# select to_number(my_Id,'9999999999999999') from table1;

It worked nicely. Thanks.

--Rick



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Char to Int
Следующее
От: Edmund Dengler
Дата:
Сообщение: Re: SET within a function?