Documentazione Invantiveparte di invantive cloud
Forum di supporto InvantiveAccedi / Registrati

XMLELEMENT

Sintassi

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

Scopo

La funzione SQL XMLELEMENT formatta un valore come elemento XML con il nome di tag specificato.

Vedi anche XMLCOMMENT, XMLDECODE, XMLENCODE, XMLFORMAT e XMLTRANSFORM.

Parametri:

  • Tag (varchar2): nome dell'elemento XML.
  • Valore (varchar2, decimal o datetime): valore da includere nell'elemento XML.
  • Mostra null (facoltativo, boolean): se restituire un elemento con xsi:nil="true" per un valore null (true) oppure null (false). Il valore predefinito è true.

Restituisce: un testo con il valore formattato come elemento XML.

Esempi

Il seguente esempio formatta il testo val come elemento XML con nome di tag Tag:

select xmlelement('Tag', 'val')

-------------------
<Tag>val</Tag>

Il seguente esempio formatta un valore null come elemento XML con nome di tag Tag:

select xmlelement('Tag', null)

-----------------------------------------------------------------------------
<Tag xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />