Re: Oracle workaround to the STUFF() MSSQL Function?

From: Jeff Lambert <jeffl_at_hypershell.com>
Date: 22 Dec 2003 06:19:19 -0800
Message-ID: <f17e7766.0312220619.11293191_at_posting.google.com>


Thank you very much...

Oleksandr_Alesinskyy_at_rambler.ru (al0) wrote in message news:<42a985d2.0312211312.41f18f79_at_posting.google.com>...
> jeffl_at_hypershell.com (Jeff Lambert) wrote in message news:<f17e7766.0312191531.3d3702d0_at_posting.google.com>...
> > I have this function everywhere in our SQL server 2000 stored
> > procedures. Has anyone written a workaround function for it? I would
> > appreciate if you could share. As you can imagine, searching the
> > groups for "stuff" returns a lot of, well... stuff. But not what I'm
> > looking for!
>
> There is no direct counterpart to this function in Oracle, you have
> write instead (if you want to replace in FirstStr m characters
> sstarting from n-tn character)
>
> substr(FirstStr,1,n-1)||SecondStr||Substr(FirstStr,n+m)
>
> Take a look on Replace function as well, as it may be handy. It
> provides "context" replacement. Here is excerpt from documentation:
>
> REPLACE returns char with every occurrence of search_string replaced
> with replacement_string. If replacement_string is omitted or null,
> then all occurrences of search_string are removed. If search_string is
> null, then char is returned.
>
> The following example replaces occurrences of "J" with "BL":
>
> SELECT REPLACE('JACK and JUE','J','BL') "Changes"
> FROM DUAL;
>
> Changes
> --------------
> BLACK and BLUE
Received on Mon Dec 22 2003 - 15:19:19 CET

Original text of this message