Link to home
Start Free TrialLog in
Avatar of nrajasekhar7
nrajasekhar7

asked on

How to increase the text file when using the UTL_FILE

I am writing the Procedure and the output of that data is storing in the text file.
 the text file sixe is 300KB

UTL_FILE.FOPEN('DIR','/filename3.txt', 'w','32767');

getting below error:
ORA-06502: PL/SQL: numeric or value error

how to incerease the output text file size.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

I'm not aware of a file size limitation using UTL_FILE but I can guarantee that 300K isn't it.

The 32767 is the maximum size for a single line that is written out.

Change the code to write the data out in sizes smaller than 32K chunks.
The last parameter to FOPEN is a number, so I wouldn't put quotes around it.

The last parameter is also the maximum size of a single line, not the maximum size of a file. (see documentation here -> http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/u_file.htm#ARPLS70924)  If you are saying that you have a 300K file that contains only one line, they you may have an issue.

I am a little confused about your question on increasing the output file size.  Are you saying that you want to add to a file rather than overwrite it?  That would be a change to the open mode, which is in the documentation link.

Also, are you sure that the open is the line that is causing the issue.
ASKER CERTIFIED SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial