SQL Language (MOSC)

MOSC Banner

Need to extract few fields from the CLOB column

Hi All,

We have a custom table where the attached XML data is being captured. In this custom table, there is a column named MESSAGE_DATA, which is of CLOB data type. From this CLOB column, we need to extract specific fields such as tns:message, tns:code, etc., for reporting purposes. Could you please share the SQL query to fetch these fields from the CLOB column?

I tried with below sql query but getting the error like "ORA-00902: invalid datatype"

select distinct x.*
from xx_clob_tab xct
,xmltable (
'/record/tns:ServiceErrorMessage/tns:message'
passing xmltype (xct.FAULT_PAYLOAD )

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center