Re: textpos() function

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: textpos() function
Дата
Msg-id 3919418A.39AE10D6@mascari.com
обсуждение исходный текст
Ответ на textpos() function  (Hitesh Patel <hitesh@presys.com>)
Список pgsql-general

Hitesh Patel wrote:
>
> > If you really don't want to update your app's code just yet, you can
> > install a pg_proc entry that defines textpos() with a CREATE FUNCTION
> > command.  But the long-term answer is to fix your code to conform with
> > the standard.
> >
> >                         regards, tom lane
>
> I changed my code to use position() instead of textpos(), the only
> problem is that I now get a parse error at the following line:
>
>         i:= position(stringa, ',');
>
> The exact error message is:
>
> ERROR: parser: parse error at or near ","
>
> Trying to run a query like, 'select position(email, ',') from table'
> fails with the same parse error, however 'select strpos(email, ',') from
> table' runs fine...
>
> any hints?

This is from memory, so please verify with the docs, but I
believe the SQL92 standared is something like:

SELECT position(',' in stringa) ...

Hope that helps,

Mike Mascari

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

Предыдущее
От: Malcolm Beattie
Дата:
Сообщение: Re: [HACKERS] pgsql/php3/apache authentication
Следующее
От: Marcin Inkielman
Дата:
Сообщение: row numbering