Delete a file using PL/SQL

Hi Experts,

We will create text files in the path of the oracle directory.

I need, like I want to delete these files in the path of the oracle directory.

Is this possible. If so please suggest me to do.

I use Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64-bit r2 Production1g

Thank you.

Hello

You can use utl_file.fremove

See UTL_FILE

Tags: Database

Similar Questions

  • Convert .xls in .csv file using pl/sql or any other method (oracle 9i)

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production

    With partitioning, OLAP and Oracle Data Mining options

    Release 9.2.0.8.0 - Production jserver

    10.1.2.0.2 generator

    ORACLE Server Release 10.1.0.4.2

    Oracle 10.1.2.0.2 procedure generator

    Oracle ORACLE PL/SQL V10.1.0.4.2 - Production

    Oracle 10.1.0.4.0 Production CORE

    Integration Services 10.1.2.0.2 tools Oracle

    Space common tools Oracle 10.1.2.0.2

    Oracle Toolkit 2 for 32-bit Windows, 10.1.2.0.2 platforms

    Resource object 10.1.2.0.2 store

    Oracle Help 10.1.2.0.2

    Oracle Sqlmgr 10.1.2.0.2

    Query Oracle 10.1.2.0.2 - Production Designer

    PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)

    Oracle ZRC 10.1.2.0.2

    Oracle XML Developers Kit 10.1.0.4.2 - Production

    Virtual graphics system Oracle 10.1.2.0.2

    Image of Oracle 10.1.2.0.2

    Widget media Oracle 10.1.2.0.2

    The GUI utility 10.1.2.0.2 tools Oracle

    I had seen a very old post of 2009.

    Convert .xls in .csv file using pl/sql

    I know that it s a long time but just wanted to know if there is a way to convert excel .csv.

    I have a directory say 'F:\purple_top\ '. I'll get the .xls file in this directory. I need to change to .csv and tables load external oracle. Any ideas or advance coding on it since 2009 so far?

    A few other options might be:

    • Java code, which can be used from within Oracle, which makes use of utility libraries (e.g. Aspose.Cells) open source (for example Apache POI) or "save under" CSV, or read the source cells and their output to a CSV file.
    • COM Automation, using available open source (for example, JACOB or j-interop) or commercial libraries, which can automate Excel to open a XLS file and "Save as" a CSV file. In addition, Oracle has a feature of COM Automation (available since version 8 but abandoned after Oracle 11g). I have successfully used this read (non-macro-enabled) Excel files in PL/SQL.
    • Other approaches using Perl or PHP can be found by googling 'convert xls to csv.

    Gerard

  • Have I done something catastrophic after deleting permanently files using disk cleanup in Windows 8?

    * Original title: disk cleanup, Windows 8

    With "Disk Cleanup" on my old XP you first identified what was not necessary, then clicked on OK and then click YES if you want to "perform these actions."

    We recently bought a new computer with Windows 8.

    Disk Cleanup is anything but after 'OK', you will be asked if you want to "permanently delete these files. Without thinking, it's that I did.

    Now I'm in a panic. I remember only one of these files... ». Windows Defender' but there is others.   I did something catastrophic?

    I'm 77. It's my wife's PC. I will reach 80?

    '

    Hello

    Please do not panic. There are slight changes in Windows 8 compared to Windows XP.

    Disk Cleanup to reduce the number of unnecessary files on your drives, which can help your PC run faster. It can remove temporary files and system files, empty the trash and remove a variety of other items that you might need is no longer.

    For more information, see the link.

    http://Windows.Microsoft.com/en-CA/Windows/delete-files-using-disk-cleanup#delete-files-using-disk-cleanup=Windows-8

    Hope this information helps. If you have any other questions, please let us know.

  • Delete a file using Java

    Hello


    I have no success with my code:
    File excluido = new File("teste.txt");
    excluido.setWritable(true, true);
    SecurityManager sm = new SecurityManager();
    try {
         sm.checkDelete(excluido.getAbsolutePath());
                   
            excluido.delete();                    
                   
    } catch (SecurityException se) {
    se.printStackTrace();
    } 
       
    SecurityException, he throws all the time, both on Windows and Linux.

    The teste.txt file is located, by the way.

    Thank you in advance for any input.

    I mean, it's obviously a matter of 'extra-Java '.

    No, it isn't. You have installed a SecurityManager. You have not installed a file .policy granted windows remove you permissions of files in this directory. You tried to delete a file in this directory. The SecurityManager prevented you. 100% pure Java, as we have said in the old days. As DrClap says, do not install a SecurityManager or create or fix your windows .policy file. See the Javadoc.

  • Delete the file using indesign SDK

    I created a new file indd for temporary use, I want to remove it after I'm done.

    I can't drop any function to delete the tmp.indd file.

    IdFichier tmpDoc;

    FileUtils::GetAppLocalCachedDataFolder (& tmpDoc, PMString ("tmp.indd"));

    Code of error err = FileUtils::CanOpen (tmpDoc);

    If (err! = kSuccess) {}

    ErrorUtils::PMSetGlobalErrorCode (err);

    return err;

    }

    SDKLayoutHelper helper;

    Status of ErrorCode = helper. SaveDocumentAs (: GetUIDRef (text), tmpDoc, kSuppressUI);

    Thank you

    Sam

    Hi Sam,

    IdFichier is derived from AFile which has the Delete member function. Probably, you need to add an include path.

    Markus

  • Create one or more files using PL - SQL

    Hi Experts,

    I have a table that contains records of 360 and want to create several files each containing 12 archive file.

    I tried to use the code below, however has been missed...

    Help, please!

    DECLARE

    NUMBER NUM: = 1;

    f_file UTL_FILE.file_type;

    row_sm NUMBER: = 0.00;

    CURSOR c_cur

    IS

    SELECT customer_key, all_columns_concat

    DEMONSTRATION;

    c_rec c_cur % ROWTYPE;

    BEGIN

    OPEN c_cur;

    LOOP

    EXTRACTION c_cur

    IN c_rec;

    OUTPUT WHEN c_cur % NOTFOUND;

    While num = c_rec.file_num

    LOOP

    f_file: = UTL_FILE.fopen ("DM_DIR", "FILE_" | num, 'w', 3267);

    NUM: = num + 1;

    END LOOP;


    UTL_FILE.put_line (f_file, c_rec.all_columns_concat);

    row_sm: = c_rec.sum_row + row_sm;

    END LOOP;


    UTL_FILE.fclose (f_file);

    NARROW C_cur;

    END;

    Kind regards

    Delight.

    -Created the 29.10.2013 by RAMIN. H

    declare

    cursor cur_select is

    Select f, f_num, lag (f_num) on prev_f_num (control f) -! Watch

    from (SELECT level f, ntile (9) on f_num (level control) FROM dual connect by level)<=>

    rec_cur_select cur_select % ROWTYPE;

    n number;

    f utl_file.file_type;

    Start

    n: = 12;

    Open cur_select;

    loop

    extraction cur_select

    in rec_cur_select;

    When the output cur_select % NOTFOUND;

    If (rec_cur_select.prev_f_num is not null and rec_cur_select.prev_f_num! = rec_cur_select.f_num) then

    UTL_FILE.fclose (f);

    end if;

    If (rec_cur_select.prev_f_num is null or rec_cur_select.prev_f_num! = rec_cur_select.f_num) then

    f: = utl_file.fopen ('GL_OUT', 'file': rec_cur_select.f_num, 'W', 3267);

    end if;

    UTL_FILE.put_line (f, rec_cur_select.f);

    end loop;

    close cur_select;

    UTL_FILE.fclose (f);

    end;

    ----

    Ramin Hashimzade

  • I can't click/open/delete this file using adobe!

    awsm.gif

    Toggle the A / V columns and checking, if it is locked.

    Mylenium

  • Error message "Cannot find the point" when deleting a file

    I'm deleting a file using two drag and drop for recycle bin and do a right-click with delete.  On several occasions, I get an error message "could not find the point".  I scanned by drive for errors, and it does not solve this problem.  Any ideas on how to get rid of this file?

    For what it's worth, the item is in my favorites folder, and this is the URL for a web page.  I don't know if the extra fact is important or not.

    THX, David

    What I did was to create a Notepad file that was empty and saved in the same location as the file that won't go away. Once registered. I click with the right button on the new file and rename the exact name as the file problem. Don't forget to change the file extension (ex: .doc)

    ex file problem: word.doc

    new file: word.doc

    as long as they match eachother exactly you should see the file problem disappear and once that's gone, you can delete the new file created.

  • How to set default cell format 'text' instead of 'general' sheet in excel using pl/sql code?

    Can someone please help me on how to generate excel file using pl/sql? I have generated csv files successfully, but now I need to generate a excel. I changed the code generation of the csv file, but the file gives me error when opening:

    "The file you are trying to open,"XXXX.xls", is in a different format than specified by the file extension. Do you want to open it now? »

    If I choose Yes then open the excel file, but it excludes the leading 0 in the front for one my column. How do I configure excel type default column as text rather than General, when you create the files? I also tried to generate excel file using xml. But I do not know how to set the type of column there, too. I'm using Oracle 11.2.0.3.0 and APEX 4.2.6.00.03. I'll call all these codes apex.

    Code1 is used:

    Declare

    output_header varchar2 (4000);

    fichier_en_sortie VARCHAR2 (255);

    Varchar2 (2) EOL: = Chr (13) | Chr (10);

    BEGIN

    output_header: = 'tls_tracking_id ' | Chr (9) | ' fnn_ext' | Chr (9) | "path_id' | EOL;

    fichier_en_sortie: = 'report_excel' |'. XLS;

    owa_util.mime_header ("application/octet ', false");

    HTP.p ('Content-Disposition: attachment; filename = "" | ") fichier_en_sortie |' « ') ;

    owa_util.http_header_close;

    HTP. PRN (output_header);

    for r in)

    Select tls_tracking_id, fnn_ext, DWD_DTOV_OUT_VW path_id

    where nbn_loc_id = 'LOC000138413115. '

    The order of tls_tracking_id LOOP)

    HTP. PRN (r.tls_tracking_id

    || Chr (9) | r.fnn_ext

    || Chr (9) | r.path_id

    || EOL

    );

    END LOOP;

    END;

    Code2 used :

    create or replace PACKAGE BODY IS pkg_excel_export

    PROCEDURE excel_open (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = ' <? XML version = "1.0" encoding = "ISO-8859-9"? > ' | Chr (10) |

    "< workbook xmlns =" "urn: schemas-microsoft - com:office:spreadsheet" ' | "

    Chr (10) |

    ""xmlns:o ="urn: schemas-microsoft-com ' ' |

    Chr (10) |

    "xmlns: x =" "urn: schemas-microsoft-com: excel" ' | "

    Chr (10) |

    ""xmlns:ss ="urn: schemas-microsoft - com:office:spreadsheet" ' |

    Chr (10) |

                            'xmlns:html=" http://www.w3.org/TR/REC-html40 ">' ||

    Chr (10) |

    ' < ExcelWorkbook xmlns = "urn: schemas-microsoft-com: excel" > ' |

    Chr (10) | ' < WindowHeight > 8580 < / WindowHeight > ' |

    Chr (10) | ' < WindowWidth > 15180 < / WindowWidth > ' | Chr (10) |

    ' < WindowTopX > 120 < / WindowTopX > ' | Chr (10) |

    ' < WindowTopY > 45 < / WindowTopY > ' | Chr (10) |

    ' < ProtectStructure > false < / ProtectStructure > ' | Chr (10) |

    ' < ProtectWindows > false < / ProtectWindows > ' | Chr (10) |

    ' < / ExcelWorkbook > ' | Chr (10) | "< Styles > | Chr (10) |

    '< ss:ID of style = 'Default' ss:Name 'Normal' = >' | Chr (10) |

    "< ss:Vertical alignment = 'Bottom' / >" | " Chr (10) |

    ' < borders / > '. Chr (10) | ' < police / > '. Chr (10) |

    ' < Interior / > '. Chr (10) | ' < NumberFormat / > '. Chr (10) |

    ' < protection / > '. Chr (10) | "< / style > | Chr (10) |

    '< ss:ID of style 's22' = >' | Chr (10) |

    "< x: font family = ss"Swiss":"BOLD"="1"ss:Underline ="Single"/ >" | "

    Chr (10) | "< / style > | Chr (10) | "< / style >";

    END excel_open;

    PROCEDURE excel_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < / workbook > ';

    END excel_close;

    / * Opens a worksheet in the Excel file. , You can open multiple worksheets. **/

    PROCEDURE worksheet_open

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_worksheetname in VARCHAR2

    ) IS

    BEGIN

    --

    -Create the worksheet

    --

    l_xml_body: = l_xml_body | "' < worksheet ss:Name = ' ' | p_worksheetname |

    "" > < table > ";"

    END worksheet_open;

    / *Farm the worksheet in the Excel file.   **/

    PROCEDURE worksheet_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < / table > < / worksheet > ';

    END worksheet_close;

    / *Opens the tag line * /

    PROCEDURE row_open (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | "< row >."

    END row_open;

    / *Farm the tag line * /.

    PROCEDURE row_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | "< / row > | Chr (10);

    END row_close;

    / *After the opening of the line, we can write something the first cell* /

    PROCEDURE cell_write

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_content in VARCHAR2

    ) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < cell > < data ss:Type = "String" > ' |

    p_content | ' < / data > < / cell > ';

    END cell_write;

    / * If you use this package of APEX, you get to download the excel file. **/

    PROCEDURE excel_get

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_filename in VARCHAR2

    ) IS

    XX BLOB;

    make the NUMBER;

    This NUMBER;

    BC NUMBER.

    LC NUMBER;

    w NUMBER;

    BEGIN

    DBMS_LOB.CREATETEMPORARY (xx, TRUE);

    make: = 1;

    so: = 1;

    BC: = dbms_lob.default_csid;

    LC: = dbms_lob.default_lang_ctx;

    w: = dbms_lob.no_warning;

    DBMS_LOB.converttoblob (xx,

    l_xml_body,

    DBMS_LOB.lobmaxsize,

    do,

    Thus,.

    British Colombia,

    LC,

    (w);

    owa_util.mime_header ("application/octet ', FALSE");

    -set the size so that the browser knows how to download

    HTP.p ("Content-length: ' |") DBMS_LOB.GetLength (xx));

    -the name of the file will be used by the browser if users only one save as

    HTP.p ('Content-Disposition: attachment; filename = "" | ") p_filename |

    '.xls ' | '"');

    -close the headers

    owa_util.http_header_close;

    -Download the BLOB

    wpg_docload.download_file (XX);

    END excel_get;

    END pkg_excel_export;

    I know it's a bit long code, but to better understand please consider...

    Thank you.

    I did worked putting just one extra line in my l_xml_body in the XML (Code 2 used). Now my excel generates with cells type 'Text' and there are no left falling to zero. Also the columns display not scientific format as 2.3D + 12. Current recording shows without default formatting.

    '

  • Jdev 12. Subversion does not detect deletions of files

    Hello world

    I use Jdev.12.1.2 and something strange happens. I deleted some of the images in the folder:

    \ViewController\public_html\images C:\JDeveloper\mywork\ < PROJECT >

    This destruction are not detected by SVN, so the images are always in the repository.

    I do not use any external SVN client. Any help?

    Thanks in advance,

    Jose.

    Thanks to all for your interest.

    I deleted the files using windows Explorer, refreshed in Jdev, and generally these destructions are detected, but not in this case.

    I tried delete file from Jdev and seems to work ok.

    I'll redownload the whole project and I will delete the files using Jdev.

    Thank you!

  • How can I delete a file on my iOS device that I downloaded from my iCloud? I just want to keep the Preview on my iOS device without using my storage iOS for the entire file.

    How can I delete a file on my iOS device that I downloaded from my iCloud? I just want to keep the Preview on my iOS device without using my storage iOS for the entire file. This means that the file is still in the iCloud and available to be downloaded to any device.

    In practice, I want to be able to scan and download through my documents located in my iCloud and once I didn't need them on my iOS device I would like 'load their return to the cloud' to my storage of the iOS device is not used.

    Thank you in advance to the community!

    Max

    The only way I found to do that once a file has been downloaded is to remove it and add it again through either from Finder on Mac or iCloud.com.

  • How can I delete a file in use by demon updater?

    How can I delete a file that says it's in use by Daemon updater.exe?

    I have a computer with a hard drive of GB 914, who recently said that it is impossible to install a program because the disk is full. While they inspected, I found that it only reported about 200 GB of usage and after you remove files non-essential, I released 57 GB of disk space.

    I made sure to show all files and installed a file tree Locator and found a log of 684 GB file but when I tried to remove it, it said that the file was not in the specified location. Then I manually found the file in system32 tree and he said that it is impossible to delete the file because it is used by daemonupdater.exe.

    can anyone help please?

    Credonem, welcome to the forum.

    I suggest start safe mode to see if that helps with your problem.  Safe mode starts only the drivers and programs needed.

    Please, click on "Thumbs Up +" if I helped you and click "Accept as Solution" If your problem is resolved.

  • How can I delete the file on my hard drive RT after getting the file to the PC host using FTP Get file vi?

    I want to get a file on my hard drive of the cRIO to my host PC. I did it by using the FTP Get file vi. After you save this file in my host PC, I want to delete the file on the cRIO. Is there a direct way to transfer the file to the host PC cRIO or do I have to manually delete the file.

    Concerning

    Dude

    Hello

    You must manually delete the file.

    Concerning

    Visuman

  • Cannot delete a file:"FILE IS in USE BY ANOTHER PROGRAM"

    I try to delete a file and get the message
    'File is used by another person or program ".

    The file has been around for several weeks.  I rebooted several times.
    I always get the message.

    Is it possible to get rid of this file?

    Bruce Hagen MS - MVP [Mail]

  • I deleted the file from my desktop using Shift + Delete how to recover this file?

    Earlier I deleted my desktop using 'Shift + delete' important file how to recover this file?

    Please see the thread of the following responses:

    How can I recover the files deleted (with shift-delete)

    This solution provided by 101 pretty much says it all.

Maybe you are looking for

  • What operating system to my old iMac (early 2009)?

    I got my new Mac and for some reason it would not start the other day. Just a gray screen with bar Apple logo more progression below that seem to take forever to do anything. Tried all the tricks to fix it, but wouldn't boot... In the end I gave up a

  • How can I disable a default amazon mp3 downloader?

    I tried to download a MP3 of Amazon and stupidly installed Amazon MP3 Downloader. I can't seem to get rid of it, or remove automatic default for MP3 downloads from the firefox options (applications). Files won't download properly with Amazon Download

  • Drive DVD Equium A100-147

    My DVD drive seems to have stopped responding. The light is not on, and it does not appear in 'my computer '! ??? Im hoping that this is just a case of a bad connection, but how can I know? Ive had a quick glance for instructions on how to get inside

  • iPhone 5 - unblock request...

    Hi people... I just inherited my daughters iPhone 5 that she now an iPhone 6... It is to replace my aging Nokia Lumia... I'm a Mac user, but a complete newbie to iPhones. Can be unlocked this phone to allow me to use my O2 sim card and, if possible,

  • missing in my laptop n011TU Bluetooth device

    I bought my hp pavilion 15 laptop n011TU about a week ago, but since the time of the purchase, I am facing problem the performance of bluetooth. I have 8 64-bit windows on my laptop and installed all the drivers (ralink, Qualcomm, intel), but still h