Re: Char to Int

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Char to Int
Дата
Msg-id 1066168436.12390.60.camel@haggis
обсуждение исходный текст
Ответ на Re: Char to Int  ("Rick Seeger" <rick@nettheory.com>)
Список pgsql-general
On Tue, 2003-10-14 at 16:11, Rick Seeger wrote:
> -----Original Message-----
>
> 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

Interesting, though, that it works for string constants:

  test1=# select cast('15' as integer);
   int4
  ------
     15
  (1 row)

  test1=# select '15'::integer;
   int4
  ------
     15
  (1 row)


--
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

When Swedes start committing terrorism, I'll become suspicious of
Scandanavians.


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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: How to list which tables are available?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Char to Int