Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to read a line from a file which contains 45000 characters?

Siva.VOct 30 2013 — edited Jan 7 2014


Hi all,

   

     Iam a receiving a .CSV file which contains n number of rows ,each row has a data seperated with delimiter.

These values based on delimiter it is seperated and certain validations are handled.

Iam using UTL_FILE.GET_LINE operator to read the value and store it in a variable which is declared as l_text VARCHAR2(30000).

when we receive a line which contains huge characters say 45000 then it throws an error(Unable to read the file).

Only on rare cases we used to receive these kind of files with huge size.

Kindly help to solve this issues.

Database details.

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

Hereby i have tried with long Raw data type but still same error unable to read the file.pls find the sample code below,

declare

l_text             LONG RAW;

l_importTypeFile   UTL_FILE.FILE_TYPE ;

begin

     PKG_COMMON.PROC_FOPEN(g_Directory, P_FILENAME,    'RB',l_importTypeFile,    p_error_cd, p_error_msg) ;

UTL_FILE.GET_RAW(l_ImportTypeFile,l_Text);

End;

Thanks in Advance

Siva

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2014
Added on Oct 30 2013
7 comments
682 views