Warning: count(): Parameter must be an array or an object that implements Countable in /membri/oraclefaq/qa-include/app/format.php on line 384
Query per estrarre il valore di un tag XML - Oracle FAQ - Il forum italiano su oracle
0 voti
20.5k visite
quesito posto in SQL e PLSQL da (2.4k punti)
Visto il sempre maggiore utilizzo degli xml può capitare di dover estrarre il valore di un determinato tag direttamente da un xml salvato in un campo CLOB.

Per estrarre il dato a video di solito utilizzo il seguente giochetto all'interno della SELECT:

substr(campo_xml,
 instr(campo_xml, '<TAG>', 1) + length('<TAG>'),
 instr(campo_xml, '</TAG>', 1) - (instr(campo_xml, '<TAG>', 1) + length('<TAG>')))

E' un pò macchinoso però sostituire n volte il TAG ed il campo che devo utilizzare, mi chiedevo se esiste qualche funzione ad hoc.

Voi cosa utilizzate? Ovviamente mi riferisco ad SQL diretto non PLSQL.

Fai il log in oppure registrati per rispondere al quesito.

Domande correlate


Warning: count(): Parameter must be an array or an object that implements Countable in /membri/oraclefaq/qa-include/app/format.php on line 384

Warning: count(): Parameter must be an array or an object that implements Countable in /membri/oraclefaq/qa-include/app/format.php on line 384

Warning: count(): Parameter must be an array or an object that implements Countable in /membri/oraclefaq/qa-include/app/format.php on line 384

Warning: count(): Parameter must be an array or an object that implements Countable in /membri/oraclefaq/qa-include/app/format.php on line 384

Warning: count(): Parameter must be an array or an object that implements Countable in /membri/oraclefaq/qa-include/app/format.php on line 384
0 voti
0 risposte 1.3k visite
0 voti
0 risposte 3.2k visite
quesito posto 10 Dicembre 2013 in SQL e PLSQL da carlo10 (2.4k punti)
0 voti
0 risposte 3.2k visite
0 voti
1 risposta 2.6k visite
quesito posto 5 Aprile 2018 in SQL e PLSQL da gr_g (150 punti)
0 voti
0 risposte 114 visite
...