How to delete a file from a Package directory

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
Post Reply
claudioreiis01
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 14
Joined: Tue, 25 Aug 2015 1:31 pm

Good afternoon guys,
I have a package that reads an XML file of an directory and inserts in a table,
I would like to know if you have any function or command that delete this directory xml file after I insert On the table.
If someone can help thank you
tora34
Rank: Analista Pleno
Rank: Analista Pleno
Posts: 108
Joined: Wed, 12 Nov 2008 6:01 pm
Location: Campo Mourão PR
Renato Pasquini
Oracle Developer

Good morning,

Is this file on your local machine or on the server?
Is this package a stored package or is it a Unit program?
claudioreiis01
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 14
Joined: Tue, 25 Aug 2015 1:31 pm

This process is a package and is on a local machine.
The Package LE An XML file inserts into a table. And after I insert into a table I need to go there in the directory
and delete this XML to not be read again.
souldeath
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 48
Joined: Wed, 25 Aug 2010 9:39 am
Location: Limeira

Claudioreiis01 The Freemove procedure of the UTL_File package should solve your problem, take a look at the documentation and see if it works: http://docs.oracle.com/cd/B28359_01/app ... m#i1003602 : Wink:
claudioreiis01
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 14
Joined: Tue, 25 Aug 2015 1:31 pm

Oops thanks gave right ... let me enjoy and ask ...
I'm reading an XML file where I pass the name of the XML as a parameter, but I wish when I did not pass the name he read all the files (xmls) that are in the directory I will put into code as I am reading the simple file is there any function that les all the files without I need to pass the name of each?
Just to be aware of me I read an XML and I carry on a table with a XmlType field where it gets all content of XML and then I extract the fields ...

0]]

Select all

 targetfile := l_bfile; 
 
    DBMS_LOB.createtemporary (l_clob, TRUE); 
    DBMS_LOB.fileopen(targetfile, DBMS_LOB.file_readonly); 
    DBMS_LOB.loadfromfile(l_clob, targetfile, DBMS_LOB.getlength(targetfile)); 
    DBMS_LOB.fileclose(targetfile);
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests