Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Gobbledegook and garbage characters in CLOB
Sun, Feb 16 2014 3:26 AMPermanent Link

Peter

Win 8.1, DXE3. 2.14 Unicode

I have to parse a bunch of downloaded ASCII reports, and I have elected to keep them in a CLOB field, with zero compression. Half of the records include garbage characters at the *end* of the CLOB, when viewed in EDB Manager, or converted to HTML.

I create a temporary stringlistA, then stringlistA.LoadFromFile to populate stringlistA. There may be multiple reports in each ASCII file, so I loop through stringlistA, and when I encounter a report break, create a new stringlistB. After some processing, stringlistB.Text is passed to a VARCHAR parameter of a stored procedure.

Somewhere along that line some rows have garbage appended to the end of the CLOB field. Sometimes the garbage is a random section of an an earlier row, and sometimes it looks like Chinese. It is not out of the question that the original ASCII files contain some corruption, but I can't see evidence of any corruption.

I don't expect that such scant information will reveal the exact nature of the issue, but I hoping that it will ring some bells amongst my learned colleagues.

Regards

Peter
Sun, Feb 16 2014 7:06 PMPermanent Link

Barry

Peter,

A VarChar is limited to 1024 characters. Try using a Clob for the stored procedure parameter.

Barry
Mon, Feb 17 2014 6:11 PMPermanent Link

Peter

Barry

Well, I *thought* that the parameter in the SP was a VARCHAR, but in fact it was a BLOB. That might explain why there were extraneous data at the end in some records. I changed it to CLOB and it works as it should, thank you.

It doesn't explain why I was sure that it was a VARCHAR though. I need a holiday Smile

Regards

Peter
Image