Current Position:Home > Reading from file where file name is not exactly known.

Reading from file where file name is not exactly known.

Update:10-11Source: network consolidation
Advertisement
Hi,
I have to read a file using utl_file. But the file name is not exactly known.
The file name would be of the syntax uplldr_XXXX.CSV , where XXXX can be any thing like 1234. so file name would be uplldr_1234.csv in that location.
How can I search the file in the specified location and process the file with name begins with 'uplldr_' .
Hope I am clear to express my needs.
regds,
ajoy

The Best Answer

Advertisement
Hi,
Yes I have to use in PLSQL UTL_FILE.
i.e.
utl_file.fopen(v_file_path,v_file_name, 'r');
and v_file_name is the name of file similar to name of 'uplldr_XXXX.csv', stored in the path v_file_path. Considering there is only one file in the specified path.
Regds,
ajoy