Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid Directory issue with UTL_FILE

727062Oct 5 2011 — edited Oct 5 2011
Hi All,

I am facing invalid directory issue with UTL_FILE package.Could any one review my below mwntioned code and correct me if any thing wrong here.

SQL> DECLARE
2 directory VARCHAR2 (300) :='$XXEQ_TOP/data/ar/invoices';
3 filename VARCHAR2 (300) :='GEM5289_04102011-03.dat';
4 l_file UTL_FILE.file_type;
5 l_text VARCHAR2 (32767);
6 l_text_not_null VARCHAR2 (32767);
7 BEGIN
8 l_file :=
9 UTL_FILE.fopen (directory,
10 filename,
11 'r',
12 32767);
13 UTL_FILE.get_line (l_file, l_text, 32767);
14 DBMS_OUTPUT.PUT_LINE('First record'||l_text);
15 UTL_FILE.fclose (l_file);
16 EXCEPTION
17 WHEN OTHERS THEN
18 DBMS_OUTPUT.PUT_LINE('Exception'||SQLERRM);
19 END;
20 /
ExceptionORA-29280: invalid directory path

PL/SQL procedure successfully completed.

Regards
Raghavendra nara
This post has been answered by BluShadow on Oct 5 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2011
Added on Oct 5 2011
4 comments
162 views