Invantive 문서Invantive Cloud의 일부
Invantive 지원 포럼로그인 / 회원가입

REPLACE

구문

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> REPLACE[REPLACE]:::quoted
    REPLACE --> End((END))

목적

The REPLACE SQL function changes a given text by replacing all occurrences from an ordered list of texts by their associated replacement texts.

TRANSLATE 및 REGEXP_REPLACE도 참조하십시오.

매개변수:

  • Input (varchar2): the text to change.
  • Old text 1 (varchar2): the text to be replaced.
  • New text 1 (varchar2): the replacement text.
  • Old text n (optional, varchar2): additional texts to be replaced.
  • New text n (optional, varchar2): additional replacement texts.

Returns: A text with all old texts replaced by their new text in the order they occur in the list.

예시

The following example replaces b by z in abc:

select replace('abc', 'b', 'z')

-------------------
azc

The following example removes b from abc by replacing it with an empty text, and replaces c by d:

select replace('abc', 'b', '', 'c', 'd')

-------------------
ad

The following example leaves the input unchanged since the old text is null:

select replace('abcd', null, 'z')

-------------------
abcd