0
Initially I needed to create a precedent that would read an xml file and put the data in an oracle table, create the table, the directory, I have the following structure:
create or replace package body PACK_GUSTAVO1 as
v_id INFO_XML.ID%type;
cursor C1 is SELECT NVL(MAX(ID)+1,1) AS ID FROM INFO_XML;
PROCEDURE IMPORTA_XML IS
BEGIN
/* ABRE CURSOR */
OPEN C1;
LOOP
/* LÊ UM REGISTRO DO CURSOR */
fetch C1 into v_id;
/* ABANDONA O LOOP CASO SEJA O FINAL DO CURSOR */
EXIT WHEN C1%NOTFOUND;
END LOOP;
/* FECHA O CURSOR */
CLOSE C1;
DBMS_OUTPUT.PUT_LINE('proximo:' || v_id);
DELETE FROM INFO_XML WHERE ID=v_id;
COMMIT;
INSERT INTO INFO_XML (ID, CONTEUDO) VALUES
(v_id, XMLTYPE(BFILENAME('CARGA_CSV', 'funcionarios.xml'), NLS_CHARSET_ID('WE8ISO8859P1')));
COMMIT;
/* grava na tabela */
END;
end PACK_GUSTAVO1;
and my select Extract value:
SELECT extractValue(CONTEUDO, '/funcionarios/contato/nome/value') as NOME FROM INFO_XML;
but it’s making a mistake, I don’t know what to do.
What error is occurring ?
– Motta
Motta, Thank you for your attention, I got a new link on the TOAD site, I based there and get to my current structure:
– Gustavo
http://www.toadworld.com/platforms/oracle/w/wiki/5998.loading-external-xml-files.aspx
– Gustavo