Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie question: Read text file from PL/SQL or SQLPlus
In article <2ZAhb.7432$qK1.6149673_at_news2.news.adelphia.net>, Baz_at_no-spam.com
wrote:
>Problem:
>-----------
>I would like to read a list of IDs from a text file on the client machine
>and fetch records for those IDs from the database. The client is a win2k
>machine with SQLPlus and TOAD. installed on it. The database is on a unix
>server.
>-------------
>
> [...]
>
>CREATE OR REPLACE PROCEDURE test_read
>IS
>file_handle UTL_FILE.FILE_TYPE;
>l_text varchar2(100);
>BEGIN
>file_handle : = UTL_FILE.FOPEN('c:\temp', 'temp.txt', 'R');
>LOOP
> utl_file.get_line(file_handle, l_text);
> dbms_output.put_line(l_text);
>END LOOP;
>utl_file.fclose(file_handle);
>end;
>
>I get the following error:
>ORA-29280: invalid directory path
>ORA-06512: at "SYS.UTL_FILE"
Is there really a directory "C:\temp" on the server? Perhaps adding the standard UTL_FILE EXCEPTION statements would help clarify things?
-- ====================================================================== ISLAM: Winning the hearts and minds of the world, one bomb at a time.Received on Sun Dec 14 2003 - 07:29:54 CST