Re: is_numeric() or extract_numeric() functions?

Поиск
Список
Период
Сортировка
От Rod Kreisler
Тема Re: is_numeric() or extract_numeric() functions?
Дата
Msg-id JNEGKNDJGBKLBDGPOPFOKEJADHAA.rod@23net.net
обсуждение исходный текст
Ответ на is_numeric() or extract_numeric() functions?  ("Ron St.Pierre" <rstpierre@syscor.com>)
Список pgsql-general
You forgot to escape the quotes:

 CREATE OR REPLACE FUNCTION getnumber(varchar(1)) RETURNS integer AS '
         BEGIN
             return ($1 ~ ''[0-9]'');
         END;
 ' LANGUAGE 'plpgsql';

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Ron St.Pierre
> Sent: Tuesday, January 28, 2003 5:56 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] is_numeric() or extract_numeric() functions?
>
>
> I can't find an is_numeric() or extract_numeric() function in postgres
> so I decided I would make my own. However, when I try to create the
> following function:
>
>
> CREATE OR REPLACE FUNCTION getnumber(varchar(1)) RETURNS integer AS '
>         BEGIN
>             return ($1 ~ '[0-9]');
>         END;
> ' LANGUAGE 'plpgsql';
>
>
> I get the following error:
>
>   parse error at or near "["
>
>
> Anyone know how to fix this, or if there is an is_numeric() or
> extract_numeric() function available?
>
> Thanks
>
> --
> Ron St.Pierre
> Syscor R&D
> tel: 250-361-1681
> email: rstpierre@syscor.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
>

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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: How do I unsubscribe?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 7.3 LOCK TABLE problem