Pasar un documento XML a una tabla Oracle
Wenas,
alguien sabe como puedo pasar un documento XML a un tabla oracle ? , gracias. Salu2
alguien sabe como puedo pasar un documento XML a un tabla oracle ? , gracias. Salu2
Necesitas tener instalado el soporte a XML, pero tengo un procedimiento sencillo que carga esto.
Le pasas el XML en un CLOB y el nombre de la tabla al que quieres insertar....
CREATE OR REPLACE procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
insCtx DBMS_XMLSave.ctxType;
rows number;
begin
insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
end;
Bueno... busca sobre DBMS_XMLSave.
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96621/toc.htm
Le pasas el XML en un CLOB y el nombre de la tabla al que quieres insertar....
CREATE OR REPLACE procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
insCtx DBMS_XMLSave.ctxType;
rows number;
begin
insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
end;
Bueno... busca sobre DBMS_XMLSave.
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96621/toc.htm
