Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
create or replace
procedure get_dir_list
(p_directory varchar2)
is
l_null varchar2(100);
l_directory varchar2(100);
BEGIN
l_directory := p_directory;
sys.dbms_backup_restore.searchfiles(l_directory, l_null);
FOR x IN (select fname_krbmsft fname from x$krbmsft) LOOP
dbms_output.put_line(x.fname);
END LOOP;
END;
--Create a temporary table to store the directory onbjects
create global temporary table DIR_LIST
( filename varchar2(255) )
on commit delete rows;
--create the java proc
create or replace
and compile java source named "DirList"
as
import java.io.*;
import java.sql.*;
public class DirList
{
public static void getList(String directory)
throws SQLException
{
File path = new File( directory );
String[] list = path.list();
String element;
for(int i = 0; i < list.length; i++)
{
element = list[i];
#sql { INSERT INTO DIR_LIST (FILENAME)
VALUES (:element) };
}
}
}
*/
--create the stored proc
create or replace
procedure get_dir_list( p_directory in varchar2 )
as language java
name 'DirList.getList( java.lang.String )';
/
--populate the temp table
exec get_dir_list( '/documentation' );
--view the results
select * from dir_list ;