Remove files in pl/sql Oracle 9i
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Remove files in pl/sql Oracle 9i

  1. #1
    Join Date
    Jun 2005
    Posts
    1

    Remove files in pl/sql Oracle 9i

    Hi,
    I looking for your help.
    The "UTL_FILE.FREMOVE ('USER_DIR', 'userdata2.txt');" command removes one 'userdata2.txt' file. I need to remove all files like 'user*.txt'. Do you know if possible in pl/sql Oracle 9i to delete all files like "file*.txt" ?
    Other option is to change permission of created file (-rw-rw-r--) to 777 and delete the file from ksh. If possible to open file with all permission?
    Thanks,
    Simon.
    Last edited by simon_shefter; 06-29-2005 at 04:28 AM.

  2. #2
    Join Date
    May 2005
    Posts
    10

    Tom Kyte to rescue

    Check out
    http://asktom.oracle.com/pls/ask/f?p...D:439619916584

    You can have your filenames stored in a GTT and then use utl_file to remove the files.

  3. #3
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,684
    Hi.

    I use either of these solutions:

    - Use the file_api to retrieve a list fo files and delete them individually:

    http://www.oracle-base.com/articles/...gFromPLSQL.php

    - Run an OS command to delete them:

    http://www.oracle-base.com/articles/...sFromPLSQL.php

    Cheers

    Tim...
    Tim...
    OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
    OCA PL/SQL Developer
    Oracle ACE Director
    My website: www.oracle-base.com
    My blog: www.oracle-base.com/blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width