UTL_FILE, Oracle PL/SQL's supplied package for reading and writing operating system files, got a nice upgrade in Oracle9i, but it still is lacking badly in one area: there is no way to ask for the list of files in a directory. Lots of people want to do this.
|
Ideally, this program would accept the directory as a literal or the name of a database directory object, and a filter - and then return the list of files that match the filter in that directory.
Something like this:
PACKAGE UTL_FILE
AS
TYPE file_names_t IS TABLE OF VARCHAR2(32767)
INDEX BY PLS_INTEGER;
FUNCTION files_in_directory (
directory_in IN VARCHAR2
, delimiter_in IN VARCHAR2
)
RETURN file_names_t;
|