top of page

How to get file names in Oracle Directory in IFS without using Complied Java Source using IFS Intface_Server_File_API.File_List

  • Writer: Rumesh Aponso (RMAX)
    Rumesh Aponso (RMAX)
  • Nov 5, 2024
  • 1 min read

Updated: Nov 13, 2024

DECLARE

file_handle_ UTL_FILE.FILE_TYPE;

directory_name_ all_directories.directory_name%TYPE;

file_list_ Intface_File_Types := Intface_File_Types();

file_count_ NUMBER;

FUNCTION Get_File_Count (

temp_directory_name_ IN VARCHAR2 ) RETURN NUMBER

IS

file_count_ NUMBER;

temp_file_list_ Intface_File_Types := Intface_File_Types();

BEGIN

file_count_ := 0;

temp_file_list_ := Intface_Server_File_API.File_List(temp_directory_name_);

FOR i IN 1..temp_file_list_.count LOOP

file_count_ := file_count_ + 1;

END LOOP;

RETURN file_count_;

END Get_File_Count;

BEGIN

directory_name_ := 'ORACLE_DIRECTORY_NAME';

file_count_ := Get_File_Count(directory_name_);

IF (file_count_ > 0) THEN

Dbms_Output.Put_Line(directory_name_ || ' - ' || file_count_);

file_list_ := Intface_Server_File_API.File_List(directory_name_);

FOR i IN 1..file_list_.count LOOP

Dbms_Output.Put_Line(file_list_(i).file_name);

END LOOP;

END IF;

END;


Comments


Copyright © 2025 RMAXOneNote

  • Online CV
  • LinkedIn
  • Youtube
  • GitHub
  • Blogger
bottom of page