Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL : reading text file from client machine
Hi Boon,
I am not clear on what you are asking.
Are you asking what you can do if you have connection to the database, but your client software is running remotely? If so, you can still read the file in using utl_file via your session, and return the corresponding text to whatever client you are using (capable of invoking a PLSQL procedure).
SQL> declare
2 l_file utl_file.file_type;
3 l_buff varchar2(32767);
4 begin
5 l_file := utl_file.fopen('/tmp', 6 'foo.txt', 7 'r'); 8 begin 9 loop 10 utl_file.get_line(l_file,l_buff,32767); 11 dbms_output.put_line(l_buff); 12 end loop; 13 exception 14 when no_data_found then 15 null;
PL/SQL procedure successfully completed.
SQL> If you are not connected to the server at all as you state (database, FTP, custom socket, HTTP, etc.), you of course won't be able to do anything on it, but my guess is that is not what you meant?
Regards,
Steve Received on Wed May 03 2006 - 12:06:12 CDT