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