|
Sybernet / Supplied Functions Reference
Release 3.00 Oct 14, 2002 |
|
The stuff function inserts a string into another string. It deletes a specified length of characters in expr1 at the start position. It then inserts expr2 string into expr1 string at the start position. If the start position or the length is negative, a NULL string is returned.
If the start position is longer than expr1, a NULL string is returned. If the length to delete is longer than expr1, it is deleted through the last character in expr1
FUNCTION STUFF
(
CHAR_EXPR1 VARCHAR2
, START NUMBER
, LENGTH NUMBER
, CHAR_EXPR2 VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
char_expr1 |
The string to be modified and returned |
start |
The one-relative starting position in char_expr1 |
length |
The number of characters from start to be deleted |
char_expr2 |
The string to be inserted into char_expr1 |
The result as a VARCHAR2.
The following example illustrates how to insert characters into a string:
select http.stuff('HelloWorld',6,0,' ') from dual
-------------------------------------------------
Hello World
The following example illustrates how to delete characters from a string:
select http.stuff('HelloWorld',4,6,NULL) from dual
-------------------------------------------------
Held