Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL : reading text file from client machine

Re: PL/SQL : reading text file from client machine

From: <stevedhoward_at_gmail.com>
Date: 3 May 2006 10:06:12 -0700
Message-ID: <1146675972.597611.210070@i40g2000cwc.googlegroups.com>


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;

 16 end;
 17 utl_file.fclose(l_file);
 18 end;
 19 /
i
am
reading
this
file
on
the
server
from
my
laptop

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US