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 manage reading a Colon from a TEXT File

vimalAug 9 2012 — edited Aug 10 2012
Hi Friends,

Currently I am writing a program to read EDI Files, Parse them and store it in a table using PL/SQL Procedure. The EDI Files are coming from various Customers.
I am able to read all the files using my program with simple utl file concepts, except the EDI file from one customer which has a colon(:) in the First line it self. Initially I didn't notice that.
all the time I got the following error.

ORA-29284: file read error
ORA-06512: at "SYS.UTL_FILE", line 18
ORA-06512: at "SYS.UTL_FILE", line 610
ORA-06512: at line 46

Then I find out the colon is the problem by comparing it with other customer's EDI file. I think the error is because all the lines after the colon are treated as bind variable.
I tried by replacing the colon with other symbol like ~ and >. It works fine for me.
I found the source of the problem. But I don't know how to overcome it. I thought with another procedure, I am able to read the line and replace it. But I am not able to.

Two lines from Two sample files

Working File:

ISA*00* *00* ZZCMACGM ZZ000158071S *120808*1329*U*00401*000000484*0*P*>
GS*QO*CMACGM*000158071S*20120808*1329*484*X*004010
ST*315*0001

Not working File:

ISA*00* *00* ZZHYUMER *01*000158071S *120810*0607*U*00401*000009068*0*P*:
GS*QO*HYUMER*000158071S*20120810*0607*9068*X*004010
ST*315*90680001

Any Ideas or Tips Please to overcome this issue.

Thanks ,
Vimal...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2012
Added on Aug 9 2012
15 comments
645 views