Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Listing files in a specified directory using PL/SQL

Tags:

sql

plsql

Is it possible to get a list of all files (and their extensions) that are stored in a specified directory using only PL/SQL? (without using Java procedures and other fancy things. Just plain PL/SQL code)

P.S. If it is possible, please tell me how to do that :)

like image 937
Denys Avatar asked Jul 01 '13 12:07

Denys


People also ask

How do I get a list of files in a directory in SQL Server?

Step 1 : Connect your SQL Server instance and open new query window in SSMS and enable SQLCMD mode in Query tab. Step 2: Copy and paste below query in query window. Step 3: Execute query and get all file name present in that folder.

What is Utl_file in Oracle with example?

UTL_FILE I/O capabilities are similar to standard operating system stream file I/O ( OPEN , GET , PUT , CLOSE ) capabilities, but with some limitations. For example, you call the FOPEN function to return a file handle, which you use in subsequent calls to GET_LINE or PUT to perform stream I/O to a file.

How do I search for a directory in SQL?

You can find the directory objects in Oracle using data dictionary view DBA_DIRECTORIES and ALL_DIRECTORIES.


1 Answers

This is not possible with plain PL/SQL but without Java. You can use a scheduler job for creating a directory listing: See https://stackoverflow.com/a/16845563/802058

like image 101
Toru Avatar answered Oct 01 '22 21:10

Toru