Ora-19025
Quando lavori con il file xml dovresti risolvere lo scenario che ha un nodo con il suo sotto-nodo.
Nel nostro caso i seguenti nodi (); ().
È abbastanza delicato trovare esattamente l’approccio che ti dà il risultato previsto. I problemi che ho avuto erano due:
– Riga duplicata
– ORA-19025 EXTRACTVALUE returns value of only one node or ORA-19279: XPTY0004 – XQuery dynamic type mismatch: expected singleton sequence – got multi-item sequence
L’immagine seguente mostra lo scenario descritto:
Riga duplicata significa che la query estrae i valori che non sono inclusi nel tuo nodo come questi in rosso. Controllare lo script duplicateRow.sql per comprendere l’errore generato.
– OrgnlRcrdId|Sts: 20170224MICMTSCINS871|RJCT
– TEMP:INS-105;It contains an invalid code
– TEMP:INS-106;The field is not registered at the system
– TEMP:INS-111;The field is not registered at the sub system
– TEMP:INS-107;thusday
– TEMP:INS-187;monday
– TEMP:INS-000;017.001.01
L’apparenza non c’è errore perché la query estrae i valori, ma se abbiamo intenzione di fare data analysis la query non si ferma al passaggio corretto delle righe duplicate generate.
Altri errori:
ORA-19025: EXTRACTVALUE returns value of only one node
It generated when we consider to extract value from VldtnRule/Id node, to replicate the error just run the following script:
ORA-19025 EXTRACTVALUE returns value of only one node.sql
i.
-
- VldtnRule XMLTYPE PATH ‘VldtnRule’
ii.
-
- XMLTABLE(
-
- ‘VldtnRule’
-
- PASSING q.VldtnRule
-
- COLUMNS Idd VARCHAR2(30) path ‘./Id’,
-
- Descc VARCHAR2(100) path ‘./Desc’ )
iii.
-
- LEFT JOIN XMLTABLE(
-
- ‘VldtnRule’
-
- PASSING q.VldtnRule
-
- COLUMNS Idd VARCHAR2(30) path ‘./Id’,
-
- Descc VARCHAR2(100) path ‘./Desc’ ) v
- ON (1=1)
Segui le istruzioni sul seguente script per avere una panoramica su quest’ultimo punto:
Scarica lo script tosolveORA-19025.sql