Home » SQL & PL/SQL » SQL & PL/SQL » Invalid file operation problem with 10g
Invalid file operation problem with 10g [message #264990] Wed, 05 September 2007 03:35 Go to next message
katle
Messages: 2
Registered: August 2007
Location: Romania
Junior Member
Hi! I have a problem that occur since my database has been migrated to the 10 g.
This is the code:

 

LOOP
      FETCH c
        INTO x; 
      EXIT WHEN c%notfound;
      raport_1(x);
      raport_2(x);
      raport_3(x);
      raport_4(x);
END LOOP;


where raport_1,.. writes reports starting from variable x.
Cursor c has 55 records and my procedures works fine for 50 records when I'm getting at the 51's record the procedure raport_1 stops with the error <<Invalid file operation>> - at line :
  f1 := utl_file.fopen(directory, FileName, 'w', 32767);


I must mention that my directory has write access (it writes the first 50 files), its size on the disc is greater then the size of the files and this problem occurs, like i said before, since I'm using Oracle 10g.
What is the problem? I hope that I make myself understood.
Thanks in advance.





Re: Invalid file operation problem with 10g [message #265109 is a reply to message #264990] Wed, 05 September 2007 07:57 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
This might not be 100% accurate, but I do remember a difference between 8i, 9i and 10g about the UTL_FILE functions. You say you have write access to the directory, but do you mean at the OS level, or through the database. A DBA will have to have given you read/write access to the directory with
grant read,write on directory {dir} to {user};

{dir} being the defined directory in DBA_DIRECTORIES.

You might also want to check the value for utl_file_dir in the show parameters output.

Just some thoughts.

[Updated on: Wed, 05 September 2007 07:57]

Report message to a moderator

Re: Invalid file operation problem with 10g [message #265125 is a reply to message #264990] Wed, 05 September 2007 08:30 Go to previous messageGo to next message
scorpio_biker
Messages: 154
Registered: November 2005
Location: Kent, England
Senior Member
Hi,

The 10g documentation say you can only have 50 files open simultaneously.

10g

I'm not sure why this suddenly became a problem but might be worth checking that they are closed?
Re: Invalid file operation problem with 10g [message #268385 is a reply to message #265125] Tue, 18 September 2007 06:59 Go to previous message
katle
Messages: 2
Registered: August 2007
Location: Romania
Junior Member
Hi
Thanks
that's was the problem, i was discovered mean while.
I have closed the file but I didn't know why they remain opened.
I put an utl_file.fcloseall and everything is OK .


Thanks a lot for your response.




Previous Topic: Cursor as out parameter
Next Topic: Query
Goto Forum:
  


Current Time: Thu Dec 12 04:48:42 CST 2024