On Saturday 26 February 2005 11:55 am, Oisin Glynn wrote:
> Did some searching on forums archives to no avail, I found a PL/Perl
> example but would like to do this in plpgsql if possible. Does somebody
> have this sitting around, I just dont want to reinvent the wheel. But if
> need to I will.
>
create or replace function reverse_string(text) returns text as
'
DECLARE
reversed_string text;
incoming alias for $1;
BEGIN
reversed_string = ;
for i in reverse char_length(incoming)..1 loop
reversed_string = reversed_string || substring(incoming from i for 1);
end loop;
return reverse
Did some searching on forums archives to no avail,
I found a PL/Perl example but would like to do
this in plpgsql if possible. Does somebody have this sitting around, I just dont
want to reinvent the wheel. But if need to I will.
Thanks in advance,
Oisin