Read XML data from database field

0

I've got a report whose query contains an XML column that I need to print. I know that there are two solutions for managging XML files printing, but to work with both I'd need to export all of my XML files from the database. But that wouldn't be a good solution because I have hundreds rows of XML fields.

  1. Option 1: XML DataSource
  2. Option 2: Remote XML DataSource

By the moment my inefficient solution is to read data fields one by one on the query like this:

     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/pagos/pago/extendedData/numeroTarjeta').getStringVal() AS NUMTARJETA
     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/pagos/pago/extendedData/balanceAmount').getStringVal() AS SALDO
     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/pagos/pago').getStringVal() AS PAGO
     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/cabecera/cantidad_articulos').getStringVal() AS TOTAL_CANTIDAD
     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/cabecera/totales/cambio/importe').getStringVal() AS CAMBIO
     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/promociones/promocion/texto_promocion').getStringVal() AS TEXTO_PROMOCION
     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/cupones/cupon/codigoCupon').getStringVal() AS CODIGO_CUPON
     , EXTRACT(XMLTYPE(TICKET.TICKET, NLS_CHARSET_ID('UTF8')), 'ticket/cupones/cupon/descripcionCupon').getStringVal() AS DESCRIPCION_CUPON
...

The only option that I think that could fits it's to read data from a remote XML but parsing the DB URL field, Does anybody knows if it's that possible?

fmm.tier1's picture
Joined: Jul 29 2020 - 1:51am
Last seen: 1 month 3 weeks ago

0 Answers:

No answers yet
Feedback