Documentazione Invantiveparte di invantive cloud
Forum di supporto InvantiveAccedi / Registrati

JSONDECODE

Sintassi

%%{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))

Scopo

La funzione SQL JSONDECODE restituisce il testo codificato in JSON come testo normale, sostituendo i caratteri speciali della rappresentazione JSON con il loro significato originale.

Vedi anche JSONELEMENT e JSONENCODE.

Parametri:

  • Input (varchar2): l'input che verrà decodificato da JSON in testo.

Restituisce: un testo che corrisponde all'input decodificato da JSON come varchar2.

Esempi

L'esempio seguente recupera la rappresentazione testuale di una rappresentazione JSON:

select jsondecode('"Special characters such as backslash (\\) and quote (\")."')

----------------
Special characters such as backslash (\) and quote (").

L'esempio seguente recupera la rappresentazione testuale di una rappresentazione JSON di un numero:

select jsondecode('5.2')

----------------
5.2

L'esempio seguente genera un errore poiché il testo non è una rappresentazione JSON:

select jsondecode('Invalid JSON')

itgenclr078: Error parsing Infinity value. Path '', line 1, position 2.