Issue with UTL_FILE.INVALID_OPERATION [message #652092] |
Wed, 01 June 2016 09:03 |
namitanamburi
Messages: 35 Registered: March 2009
|
Member |
|
|
Hello,
I have a package which
identifies clients that need to receive files.
LOOP
Calls a procedure that opens 7 files per client.
Writes to the files.
Then closes the files.
End loop
I am encountering issue while opening 7th file of 44th client, it is not opening 7th file and ends up with error
Unable to open file due to UTL_FILE.INVALID_OPERATION
Solutions Tried:
In order to identify if 44th client is cause, I deleted the 44th client and encountered same issue with 45th client.
I am using a simple OPEN_NEW_FILE to open the files by passing in (location, file_name, 'W')
FUNCTION OPEN_NEW_FILE(P_LOCATION VARCHAR2,
P_FNAME VARCHAR2,
P_FP IN OUT UTL_FILE.FILE_TYPE,
P_MODE VARCHAR2 := 'w'
)
RETURN VARCHAR2 IS
BEGIN
p_fp := utl_file.fopen(p_location, p_fname, p_mode);
RETURN '';
EXCEPTION
WHEN UTL_FILE.READ_ERROR THEN RETURN 'Unable to open file due to UTL_FILE.READ_ERROR';
WHEN UTL_FILE.WRITE_ERROR THEN RETURN 'Unable to open file due to UTL_FILE.WRITE_ERROR';
WHEN UTL_FILE.INVALID_PATH THEN RETURN 'Unable to open file due to UTL_FILE.INVALID_PATH';
WHEN UTL_FILE.INVALID_MODE THEN RETURN 'Unable to open file due to UTL_FILE.INVALID_MODE';
WHEN UTL_FILE.INVALID_OPERATION THEN RETURN 'Unable to open file due to UTL_FILE.INVALID_OPERATION';
WHEN UTL_FILE.INTERNAL_ERROR THEN RETURN 'Unable to open file due to UTL_FILE.INTERNAL_ERROR';
WHEN OTHERS THEN RETURN 'Unable to open file in OPEN_FILE function';
END;
I am using the same function to open 7 different files for each client, 1st, 2nd ....43 times I have no issues to open file, once I hit 44 I ran into this.
Is there a limit I am reaching, please advise. I checked the space on the server and that is not an issue.
Thank You
Namita
|
|
|
|
|
|
|
Re: Issue with UTL_FILE.INVALID_OPERATION [message #652104 is a reply to message #652100] |
Wed, 01 June 2016 14:03 |
Solomon Yakobson
Messages: 3273 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
UTL_FILE is executed on database server, not on client machine. So it's not clear what do you mean by client. Are clients connecting to same database or not? Are file names client specific, if clients connects to same database?
SY.
|
|
|
|
|