Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to delete a flat file in SQL

Re: How to delete a flat file in SQL

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Mon, 28 Jan 2002 12:29:22 -0000
Message-ID: <1012220890.16346.0.nnrp-02.9e984b29@news.demon.co.uk>

You mean something like:

    execute dbms_backup_restore.deletefile('$ORACLE_HOME/bin/oracle')

(I'm not sure the $ORACLE_HOME bit would literally work by the way).

It's certainly a case where you should hide the procedure call in a package which exposes only the deletefile() procedure from the dbms_backup_restore package. (A bit like the dbms_lock, user_lock packages). In that case, you could always wrap the call in a piece of code (e.g. asks for a directory in the utl_file_dir list, and a file name, validates the directory using a utl_file call, and then deletes the file).

--
Jonathan Lewis
http://www.jlcomp.demon.co.uk

Now running 3-day intensive seminars
http://www.jlcomp.demon.co.uk/seminar.html

Host to The Co-Operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Author of:
Practical Oracle 8i: Building Efficient Databases


George Barbour wrote in message <3c553cdb$1_at_pull.gecm.com>...

>Looking at the procedure, strikes me that it is possibly dangerous in the
>wrong hands.
>George Barbour.
>"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message
>news:1012155772.16744.0.nnrp-02.9e984b29_at_news.demon.co.uk...
>>
>> In 8.1, there is an undocumented procedure in package
>> dbms_backup_restore called "deletefile", as in:
>>
>> execute dbms_backup_restore.deletefile('/tmp/temp.txt')
>>
>> Check $ORACLE_HOME/rdbms/admin/dbmsbkrs.sql
>> before trying it.
>>
Received on Mon Jan 28 2002 - 06:29:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US