JSONDECODE
Syntaxe
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> JSONDECODE[JSONDECODE]:::quoted
JSONDECODE --> End((END))
Objet
La fonction SQL JSONDECODE renvoie le texte encodé au format JSON sous forme de texte brut, en remplaçant la représentation JSON des caractères spéciaux par leur signification d'origine.
Voir également JSONELEMENT et JSONENCODE.
Paramètres :
- Entrée (
varchar2) : l'entrée qui sera décodée du format JSON vers du texte.
Renvoie : une chaîne de caractères correspondant à la donnée d'entrée décodée à partir du format JSON sous la forme varchar2.
Exemples
L'exemple suivant permet de récupérer la représentation textuelle d'une représentation JSON :
select jsondecode('"Special characters such as backslash (\\) and quote (\")."')
----------------
Special characters such as backslash (\) and quote (").
L'exemple suivant récupère la représentation textuelle d'une représentation JSON d'un nombre :
select jsondecode('5.2')
----------------
5.2
L'exemple suivant génère une erreur, car le texte n'est pas une représentation JSON :
select jsondecode('Invalid JSON')
itgenclr078: Error parsing Infinity value. Path '', line 1, position 2.