1 Answer
- Newest
- Most votes
- Most comments
0
Fortunately it is possible to reimplement the rdsadmin.rds_file_util.read_text_file util like this:
function read_file(p_directory varchar2, p_filename varchar2) return varchar2 as
v_file utl_file.file_type;
v_buffer_size pls_integer := 32767;
v_buffer varchar2(32767);
v_output varchar2(32767) := '';
begin
v_file := utl_file.fopen(p_directory, p_filename, 'r', v_buffer_size);
loop
begin
utl_file.get_line(v_file, v_buffer);
v_output := v_output || CHR(10) || v_buffer;
exception when no_data_found then exit;
end;
end loop;
utl_file.fclose(v_file);
return v_output;
end;
It works for shorter logs up to 32767 characters in length. Otherwise it should be possible to use CLOB instead of VARCHAR2, but VARCHAR2 is enough for reading e.g. task logs from rdsadmin.rdsadmin_s3_tasks.upload_to_s3.
answered 4 years ago
Relevant content
- Accepted Answer
- asked 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago