tags:

views:

68

answers:

3

Hi all

I have two questions.

(1) how to make move text file from folder:

C:\Data\inbox\test.txt

to target Folder?

C:\Data\outbox\test.txt

(2) how to make get list of directory files in Folder?

C:\Data\inbox\

Thank you...

+1  A: 

Have a look at UTL_FILE?

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm

cagcowboy
UTL_FILE cannot get a list of files from a directory.
Jeffrey Kemp
+1  A: 

Where you say:

2-) Question Two

Folder: C:\Data\inbox\

how to make get directory files list ?

Tom Kyte has a nice solution shown here

carpenteri
+4  A: 

Oracle provides a package of utilities for working with files, UTL_FILE. Since 9i this has included the FRENAME() procedure, which works like the unix mv command. We can use it to rename the file and/or its directory. Note that the Oracle os account must have read and write privileges on both directories. Also this procedure uses DIRECTORY objects, rather than explicit paths.

As for getting a list of files in a directory, there is no Oracle built-in. One solution is to use a Java Stored Procedure. Tom Kyte has an example of this. Find it here. There is another way of doing it since 11.1.0.7, which is to use an external table pre-processor file. Adrian Billington wrote a nice article on this. The executed file is platform dependent.

APC