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 :)
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.
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.
You can find the directory objects in Oracle using data dictionary view DBA_DIRECTORIES and ALL_DIRECTORIES.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With