472,129 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,129 software developers and data experts.

Calling Operating system command from Database

I want to read a file list in a directory from a database procedure. I
m using Oracle 9i Release 2. How to do??? I don't want to user
external procedures. I know it can be done through java stored
procedure. Any other solution like a single command......Java code is
still ok...

Regards,

Adnan
Jul 19 '05 #1
1 4288

Originally posted by Adnan
I want to read a file list in a directory from a database procedure. I
m using Oracle 9i Release 2. How to do??? I don't want to user
external procedures. I know it can be done through java stored
procedure. Any other solution like a single command......Java code is
still ok...

Regards,

Adnan

There isn't a prebuilt "single command" solution. You have to write a
java stored procedure and a PLSQL wrapper procedure.

Read java docs and Look at list() or listFiles() functions in
"File" interface in "java.io" API. Goto http://tahiti.oracle.com
for Oracle docs.

Hint:
import java.io.*;
public class foo {
public static String getFileList (String dirname) {
....
File dir = new File(dirname);
String[] entries = dir.list();
...
}
}

Regards
/Rauf Sarwar

--
Posted via http://dbforums.com
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Joseph Suprenant | last post: by
27 posts views Thread by Kevin A | last post: by
3 posts views Thread by Capsule | last post: by
10 posts views Thread by Vavel | last post: by
3 posts views Thread by PythonUsr | last post: by
1 post views Thread by newstips6706 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.