469,267 Members | 1,091 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

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 4172

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.