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