This is simply a blog containing small code snippets I found useful during my work!
mercoledì 9 aprile 2014
File system access on Oracle
It may sound easy, but accessing the file system from oracle can be painful.
I am not talking about read / write a file. I am talking about making a ls or dir command, crete folders, move files, etc.
In this post I would like to recall an easy system about making ls.
Actually the solution is already very well explained in this web page:
http://plsqlexecoscomm.sourceforge.net/
The solution is mainly based on a java package installed in the Oracle DB, which is accessing the file system and arranging the data in a proper way.
First of all it is needed to install the package (available on the link above) and then perform a simple query like the one below:
select *
from table(
file_pkg.get_file_list(file_pkg.get_file('/'))
)
And here you are: you get the result of a ls command executed on the root accessible as a simple select.
Iscriviti a:
Commenti sul post (Atom)
Nessun commento:
Posta un commento