DBMS_XMLDOM.WRITETOBUFFER Writes the contents of the node to a buffer.
DBMS_XMLDOM.WRITETOCLOB Writes the contents of the node to a CLOB.
DBMS_XMLDOM.WRITETOFILE Writes the contents of the node to a file.
Ich habe PL/SQL-Code, wites es in dem Dateisystem mit einem Verzeichnis:
dbms_xmldom.writeToFile(dbms_xmldom.newDOMDocument(xmldoc)
,'DATAPUMPDIR/myfile.xml') ;
ich habe eine Funktion dbms_xmldom.writetoclob erstellt
create or replace function xml2clob (xmldoc XMLType) return CLOB is
clobdoc CLOB := ' ';
begin
dbms_xmldom.writeToClob(dbms_xmldom.newDOMDocument(xmldoc)
,clobdoc) ;
return clobdoc;
end;
/
Abfrage:
SELECT xml2clob(Sys_Xmlagg(
Xmlelement(Name "dummy"
,dummy
),Xmlformat('dual')))
FROM dual;
Ausgang:
<?xml version="1.0"?>
<dual>
<dummy>X</dummy>
</dual>
Sie könnten versuchen, eine Funktion wie diese verwenden:
create or replace function dom2clob (domdoc DBMS_XMLDOM.DOMDocument) return CLOB is
clobdoc CLOB := ' ';
begin
dbms_xmldom.writeToClob(domdoc,clobdoc) ;
return clobdoc;
end;
/