개인적인 정리

[Oracle]REPLACE() 본문

DB/ORACLE

[Oracle]REPLACE()

yeon.Biju 2020. 6. 10. 14:08

오라클 REPLACE

 

REPLACE()

   - 

 

REPLACE(char, search_string)

REPLACE(char, search_string, replacement_string)

의 형태

 

REPLACE returns char with every occurence of search_string replaced with replacement_string. If replacement_string is omitted or null, then all occurence of search_string are removed. If search_string is null, then char is returned.

 

Both search_string and replacement_string, as well as char, can be any of the data types CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is in the same character set as char. The function returns VARCHAR2 if the first argument is not a LOB and returns CLOB if the first argument is a LOB.

 

REPLACE provides functionality related to that provided by the TRANSLATE function. TRANSLATE provides single-character, one-to-one substitution. REPLACE lets you substitute one string for another as well as remove character strings.

 

SQL> SELECT REPLACE('JACK and JUE', 'J', 'BL') FROM DUAL ;

   --> BLACK and BLUE

'DB > ORACLE' 카테고리의 다른 글

[Oracle]RPAD()  (0) 2020.06.11
[Oracle]ROW_NUMBER()  (0) 2020.06.11
[Oracle]ROUND(number)  (0) 2020.06.10
[Oracle]ROUND(date)  (0) 2020.06.10
[Oracle]REMAINDER()  (0) 2020.06.10
[Oracle]REGEXP_SUBSTR()  (0) 2020.06.08
[Oracle]REGEXP_REPLACE()  (0) 2020.06.08
[Oracle] REGEXP_INSTR()  (0) 2020.04.21
Comments