Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: STUFF command

Re: STUFF command

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Wed, 31 Mar 2004 06:25:20 -0500
Message-ID: <-LidnZCLncNUN_fdRVn-tA@comcast.com>

<grille11_at_yahoo.com> wrote in message
news:c4e6ad$k1n$1_at_reader1.imaginet.fr...
| Hello,
|
| I am trying to find the equivalent of the STUFF command from SQL (deletes
a
| specified length of characters and inserts another set of characters at a
| specified starting point).
| Would someone knows this?
| thanks in advance
|
|
| This example returns a character string created by deleting three
characters
| from the first string (abcdef) starting at position 2 (at b) and inserting
| the second string at the deletion point.
|
| SELECT STUFF('abcdef', 2, 3, 'ijklmn')
| GO
| ---------
| aijklmnef
|
|
|
|
|

no such stuff in oracle

you will need use a combination of substr to get the 2 pieces that you want to preserve, and use string concatenation to combine the pieces with the new string

also, take a look at REPLACE and TRANSLATE (and other string functions listed in the Oracle SQL Reference)

;-{ mcs Received on Wed Mar 31 2004 - 05:25:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US