Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62

    Thumbs up Unanswered: utl_file path problem

    hi,

    create or replace PROCEDURE TEST_READ
    IS
    file_handle UTL_FILE.FILE_TYPE;
    data_line Varchar2(1023);
    BEGIN
    file_handle := UTL_FILE.FOPEN('CSVS','BED.txt','R');
    LOOP
    begin
    UTL_FILE.GET_LINE(file_handle, data_line);
    data_line:= rtrim(ltrim(data_line));
    dbms_output.put_line(data_line);
    EXCEPTION
    WHEN NO_DATA_FOUND then EXIT;
    end;
    END LOOP;
    UTL_FILE.FCLOSE(file_handle);
    END;
    /

    SQL> exec test_read
    BEGIN test_read; END;

    *
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 18
    ORA-06512: at "SYS.UTL_FILE", line 424
    ORA-06512: at "SCOTT.TEST_READ", line 6
    ORA-06512: at line 1

    here CSVS is a directory inside my server
    i tested by giving the full path also

    /data2/oradata/bas/csvs

    but still im getting the same error..
    did i missed anything here.

    thanx.

  2. #2
    Join Date
    Dec 2003
    Location
    Noida, India.
    Posts
    171
    Your instance initialization parementer (init.ora) needs to have the setting for absolute path that you use:
    /data2/oradata/bas/csvs
    Oracle can do wonders !

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    191
    Hi,
    Have done following steps:
    1)Connect as sys
    2)CREATE DIRECTORY UTL_DIR AS 'C:\oracle\UTL_DIR';
    3)Grant read on the directory
    4)grant read on directory UTL_DIR to public;
    5)set UTL_FILE_DIR parameter
    UTL_FILE_DIR = <directory name>

    Thanks,
    Pagnint
    (No need to search web before posting new question)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •