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 work with Unix files from stored procedure?

Re: How to work with Unix files from stored procedure?

From: Mark Gumbs <mgumbs--AT--hotmail.com>
Date: Tue, 18 May 1999 14:41:36 +0100
Message-ID: <37416c01.0@145.227.194.253>


You can try issuing a host command to do a directory listing and pipe it to a file.
You then have 2 options.

  1. Use utl_file to read all the lines in this file and put them in a multi record block, record group etc.
  2. Use utl_file to read all the values into a table and your multi record block or LOV can refer to this.

Assuming that you are using a multi record block, you need some way of flagging the files and once selected, loop through all the checked items issuing a host command to delete them (not forgetting the path name!).

I did this once and worked fine

I never used dbms_pipe so have no comment on it really. Look into it, it may be better.

HTH Mark

Joep Hendrix wrote in message
<0E16861EE7BCD111BE9400805FE6841F09385018_at_c1s5x001.cor.srvfarm.origin-it.com
>...
>I think in Oracle 8 there is a host command available in the database.
>If you are using an older version then you could use dbms_pipe in combined
>with a deamon proces.
>
>Joep Hendrix
>
>DungDX_at_hotmail.com wrote in message <7hotbs$89r$1_at_nnrp1.deja.com>...
>>I need to make a list of files (equivalent to statement 'DIR' in
>>Windows) in a specified directory of a Unix server from a stored
>>procedure and then delete some of the files listed. Does any one
>>know how to do it? If possible, please include sample codes in the
>>answer sent to me.
>>Looking forward to receiving the answer.
>>Thanks in advance.
>>Xuan Dzung.
>>
>>-----------== Posted via Deja News, The Discussion Network ==----------
>>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>
Received on Tue May 18 1999 - 08:41:36 CDT

Original text of this message

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