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

From: al0 <Oleksandr_Alesinskyy_at_rambler.ru>
Date: 21 Dec 2003 13:12:15 -0800
Message-ID: <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 Sun Dec 21 2003 - 22:12:15 CET

Original text of this message