Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> UTL_FILE fopen problem!!!!!
I´m having problems opening a file using UTL_FILE package. I add the line UTL_FILE_DIR = * to the init.ora
When I´m trying to open the file, the exception "Invalid_operation"
appeared. It seems that I don´t have permissions to read/write files
but with the user I´m using on the net has it in NT. The path is with
the same case sensitive as I have it..
What Can I do?? I´ll appreciate if someone could help me. Thanks
This is the code I´m using:
DECLARE
p_FileDir varchar2(20); p_FileName varchar2(20); v_FileHandle UTL_FILE.FILE_TYPE; v_NewLine varchar2(24); v_VAC varchar2(3); v_Desc varchar2(23); v_Filler varchar2(1);
BEGIN
p_FileName := 'cmwvacd.dat'; p_FileDir := 'c:\Temp'; v_FileHandle := UTL_FILE.FOPEN(p_filedir, p_fileName, 'r');LOOP
UTL_FILE.GET_LINE(V_FileHandle, v_newLine); EXCEPTION WHEN NO_DATA_FOUND THEN EXIT; END; v_VAC := SUBSTR(v_NewLine, 1, 3); v_Desc := SUBSTR(v_NewLine, 4, 23); v_Filler := SUBSTR(v_NewLine, 24, 24); INSERT INTO NADA_ACCESORY_TYPES (NAAT_DESCRIPTION, NAAT_VAC) VALUES (v_desc, v_VAC);END LOOP;