DBMS_METADATA.GET_XML(..) - CLOB output
-- In the query below the table object description is
-- output as CLOB.
-- Other functions in DBMS_METADATA package are
-- GET_DEPENDENT_XML and GET_GRANTED_XML  
-- Note: The output has been cut off (SQL Developer)

SELECT
 DBMS_METADATA.get_xml('TABLE',UPPER('cms_web_content')) xml_out
FROM DUAL;

DBMS_METADATA.GET_XML(..) - CLOB output
DBMS_METADATA.GET_XML(..) - CLOB output to VARCHAR2(4000)
-- In the query below the table object description 
-- output is converted from CLOB to VARCHAR2(4000) 
-- using DBMS_LOB.substr()
-- Note: The output has been cut off for convenience

SELECT DBMS_LOB.substr(q_tab.xml_out,4000,1)  xml_out
FROM 
 (SELECT
   DBMS_METADATA.get_xml('TABLE',UPPER('cms_web_content')) xml_out
  FROM DUAL) q_tab;

DBMS_METADATA.GET_XML(..) - output converted to VARCHAR2(4000)

DBMS_METADATA.Get_DDL

Oracle registered trademark of Oracle Corporation.

Last Revised On: August 17, 2014

  1387