Home » SQL & PL/SQL » SQL & PL/SQL » why i can get this error?
why i can get this error? [message #281504] Sat, 17 November 2007 15:01 Go to next message
futi
Messages: 22
Registered: November 2007
Junior Member
i am new for oracle. and i am trying to read from a file.

DECLARE
V1 VARCHAR2(32767);
F1 UTL_FILE.FILE_TYPE;
BEGIN
F1 := UTL_FILE.FOPEN('C:\', '1.txt', 'R', 256);
UTL_FILE.GET_LINE(F1, V1, 32767);
UTL_FILE.FCLOSE(F1);
END;

when i write this code in pl sql developer, i am encountering this error :
ORA-29280 invalid directory path
Re: why i can get this error? [message #281505 is a reply to message #281504] Sat, 17 November 2007 15:04 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Your syntax for UTL_FILE is incorrect. Refer to Using UTL_FILE for the correct procedures.
Re: why i can get this error? [message #281506 is a reply to message #281504] Sat, 17 November 2007 15:06 Go to previous messageGo to next message
zoltanp
Messages: 58
Registered: March 2005
Location: Hungary
Member
UTL_FILE works in server side.

I made this error too. Smile


Regards,

Zoltán Patalenszki
Re: why i can get this error? [message #281507 is a reply to message #281506] Sat, 17 November 2007 15:23 Go to previous messageGo to next message
futi
Messages: 22
Registered: November 2007
Junior Member
i have examined it and ok i understand a lot. but i couldnt done this again.

how can i read/write a textfile with pl sql , is there any example about this? ( oracle 10g express edition on windows )

thanx
Re: why i can get this error? [message #281508 is a reply to message #281504] Sat, 17 November 2007 15:33 Go to previous messageGo to next message
zoltanp
Messages: 58
Registered: March 2005
Location: Hungary
Member
You have to create an alias to the directory in os.

CREATE DIRECTORY mydir AS 'c:\';
GRANT READ ON DIRECTORY mydir TO PUBLIC;

and then you can use:
F1 := UTL_FILE.FOPEN('mydir'
Re: why i can get this error? [message #281548 is a reply to message #281507] Sun, 18 November 2007 02:02 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
PL/SQL Packages and Types Reference, UTL_FILE

Regards
Michel
Previous Topic: Query hanging
Next Topic: Install PL/SQL Examples in my current user
Goto Forum:
  


Current Time: Sat Dec 03 09:51:21 CST 2016

Total time taken to generate the page: 0.04657 seconds