Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Obtendo o timestamp de um arquivo usando PL/SQL


Acho que você terá que fazer isso escrevendo um procedimento java, conforme descrito aqui por Tom Kyte:

http://asktom. oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584
GRANT JAVAUSERPRIV to <your user>
/
create global temporary table DIR_LIST
( filename varchar2(255) )
  on commit delete rows
/
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 or replace procedure get_dir_list( p_directory in varchar2 )
    as language java
    name 'DirList.getList( java.lang.String )';
/