Note: If the number of files is expected to be large, it would be better to get the java program to insert the file names into a global temporary table, then query that, instead of returning the list as a CSV string.

Rate this:

Share this:

Like this:

Related

I’ve got a similar Java Stored Procedure based on one from Tim Hall of Oracle-Base. Mine returns the list as an array of String, then the PL/SQL shell package can return the array via a pipelined table function. That means that I can SELECT * FROM TABLE(my_pipeline_function).

Thanks Connor, good to mention it for future visitors, if there are any :)

I was aware of that one. This post was about a 10g database though (I probably should have mentioned that).

If/when they upgrade to 11g I’d probably look at removing this entire thing anyway, because the only reason we want a directory listing is to drive a home-grown “File Watcher” – and 11g has a built-in File Watcher feature in dbms_scheduler.