erwin
erwin

Reputation: 1

How to get filename from Oracle Directory from PL/SQL?

I have created an Oracle Directory on my local computer (c:\temp), and as an example I also put several files inside that directory:

My question is how I can get all the filenames inside that directory from PL/SQL?

Thank you

Upvotes: 0

Views: 6350

Answers (1)

Justin Cave
Justin Cave

Reputation: 231661

You can't. PL/SQL doesn't provide a function to list the contents of a directory.

Assuming that the Oracle database is installed on your local server (the database generally cannot access files stored on the client file system) you can, however, create a Java stored procedure that lists the contents of an operating system directory and call that from PL/SQL. The thread I links to provides one implementation of this sort of procedure. There are other implementations floating around on the internet as well.

Upvotes: 1

Related Questions