 |
 |
Archives of the TeradataForum
Message Posted: Tue, 14 Sep 2004 @ 18:26:21 GMT
Subj: | | Re: UDF's without using C |
|
From: | | paul.burns |
You wrote:
| "anybody got a decent example of using straight sql to return the reverse of a variable-length string ?" | |
Okay this may or may not be a "decent example" but it could be a start depending on the length of the string.
select name
, Trim(substr(name,char(name),1) || substr(name,char(name)-1,1) ||
substr(name,char(name)-2,1 ) || substr(name,char(name)-3,1 ) ||
substr(name,char(name)-4,1 ) ) eman
from
( select 'paul '(varchar(5)) name ) dt ;
Paul
| |