JSONDECODE
Sintaxis
%%{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))
Propósito
La función SQL JSONDECODE devuelve el texto codificado en JSON como texto normal, sustituyendo la representación JSON de los caracteres especiales por su significado original.
Véanse también JSONELEMENT y JSONENCODE.
Parámetros:
- Entrada (
varchar2): la entrada que se decodificará de JSON a texto.
Devuelve: un texto que corresponde a la entrada descodificada desde JSON como varchar2.
Ejemplos
El siguiente ejemplo recupera la representación textual de una representación JSON:
select jsondecode('"Special characters such as backslash (\\) and quote (\")."')
----------------
Special characters such as backslash (\) and quote (").
El siguiente ejemplo recupera la representación textual de una representación JSON de un número:
select jsondecode('5.2')
----------------
5.2
El siguiente ejemplo genera un error, ya que el texto no es una representación JSON:
select jsondecode('Invalid JSON')
itgenclr078: Error parsing Infinity value. Path '', line 1, position 2.