Re: [SQL] Reverse String in sql or pgplsql

2005-02-26 Thread Larry Rosenman
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. >

Re: [SQL] Reverse String in sql or pgplsql

2005-02-26 Thread Bradley Miller
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

[SQL] Reverse String in sql or pgplsql

2005-02-26 Thread Oisin Glynn
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