简体   繁体   中英

Get value from table oracle (xmltype)

How can i get xml data from a table,

CREATE TABLE PCRD_3DS_SOAP_LOGS
(
  SERVICE_NAME  VARCHAR2(50 BYTE)               NOT NULL,
  REQUEST_ID    VARCHAR2(50 BYTE)               NOT NULL,
  ERROR_CODE    CHAR(5 BYTE),
  REQUEST       SYS.XMLTYPE,
  RESPONSE      SYS.XMLTYPE,
  USER_CREATE   VARCHAR2(15 BYTE),
  DATE_CREATE   DATE,
  USER_MODIF    VARCHAR2(15 BYTE),
  DATE_MODIF    DATE
)

I get this error when I execute the select query:

select * from PCRD_3DS_SOAP_LOGS
 Access violation at address 659A0C4B in module 'OraClient12.Dll'. Read of address 00000008
SELECT * FROM PCRD_3DS_SOAP_LOGS;

Should work, however, if Toad cannot handle the XMLTYPE data type then you can explicitly convert them to a string using XMLTYPE 's getStringVal or getClobVal methods :

SELECT service_name,
       request_id,
       error_code,
       p.request.getClobVal() AS request,
       p.response.getClobVal() AS response,
       user_create,
       date_create,
       user_modif,
       date_modif
FROM   PCRD_3DS_SOAP_LOGS p;

(You do need to include the table name or alias before the column name.)

db<>fiddle here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM