Re: trimming functions.

Поиск
Список
Период
Сортировка
От Hubert Lubaczewski
Тема Re: trimming functions.
Дата
Msg-id 20030623134746.1c3b38e0.hubert.lubaczewski@eo.pl
обсуждение исходный текст
Ответ на trimming functions.  (javier garcia - CEBAS <rn001@cebas.csic.es>)
Список pgsql-general
On Mon, 23 Jun 2003 12:41:19 +0200
javier garcia - CEBAS <rn001@cebas.csic.es> wrote:

> So I still need to improve the SELECT to remove all possible symbols after
> the first group of alphabet characters to get a 'code_trimmed' column with
> just the characters:(NJ, AG, OL, LI, I, NJ, PH, AG, PD, L, M, MD, L).
> Possible 'non alphabet' symbols are '{+/^('
> Any idea?

simple pl/perl function should do the trick.

maybe something like this:
create function d_trim(text) returns text as '
    my $sString = shift;
    $sString =~ s/^\\(*([A-Z]+).*$/$1/;
    return $sString;
' language 'plperl';

i'm not entirelly sure if this function will work - i wrote it without anytesting, but it is so simple, one shouldn't
haveany problems correcting/modifying it's behaviour. 

depesz

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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [pgsql-advocacy] interesting PHP/MySQL thread
Следующее
От: "Kallol Nandi"
Дата:
Сообщение: Lotus Domino and PostgreSql in Linux