Home » SQL & PL/SQL » SQL & PL/SQL » Getting the UNIX file size from PLSQL
Getting the UNIX file size from PLSQL [message #205214] Thu, 23 November 2006 23:03 Go to next message
Messages: 94
Registered: October 2004

I have got a unique requirement. I will be provided with a directory name with the entire UNIX path. From the directory name I will have to collect all the subdirectory name. Within each subdirctory there will be only 1 file. I need to extract each of these filenames, its creation date and push all these information into a UNIX file.

Can anyone please help me on this.
I tried to use the prorgam as in the link below but it shows Java is not installed.

SQL> create or replace
2 and compile java source named "DirList"
3 as
4 import java.io.*;
5 import java.sql.*;
7 public class DirList
8 {
9 public static void getList(String directory)
10 throws SQLException
11 {
12 File path = new File( directory );
13 String[] list = path.list();
14 String element;
16 for(int i = 0; i < list.length; i++)
17 {
18 element = list[i];
20 VALUES (:element) };
21 }
22 }
24 }
25 /
create or replace
ERROR at line 1:
ORA-29538: Java not installed


Here is the information on my database
Oracle Database 10g Enterprise Edition Release - 64bi
TNS for Solaris: Version - Production
Re: Getting the UNIX file size from PLSQL [message #205239 is a reply to message #205214] Fri, 24 November 2006 00:52 Go to previous message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
In 10g it is possible to execute an operating system command using the DBMS_SCHEDULER package.

Ross Leishman
Previous Topic: connect by prior, how to get all the level even started from middle
Next Topic: Rownum inside 'Exists' subquery
Goto Forum:

Current Time: Mon Jul 24 11:56:24 CDT 2017

Total time taken to generate the page: 0.17957 seconds