COPY-LOB to a file crashed OpenEdge Graphical Client

Posted by Marc on 14-May-2013 03:31

Hi all,

I'm trying to store a PDF file in a BLOB field in database, and then getting it back to a temp directory.

But the restored file contains some differences with the file I stored (adding some characters to the beginning of the file, making the PDF file corrupted) and the application stops with an openedge error !

Here are the lines I use to do it :

Storing with

    COPY-LOB FROM FILE fileName TO ged.dataFile NO-CONVERT NO-ERROR.

Creating back the file with
     COPY-LOB FROM GED.dataFile TO FILE SESSION:TEMP-DIRECTORY + fileName NO-CONVERT NO-ERROR.
is there something wrong ?
Thanks

(OpenEdge Release: 11.0.0)

All Replies

Posted by David Moloney on 14-May-2013 09:16

My guess is that OE is prefixing the LOB to FILE copy with BOM characters.

Do the prefixed values look anything like these?

UTF-8 0xEF,0xBB,0xBF

UTF-16 (LE) (U+FEFF)

UTF-16 (LE) (U+FFFE)

UTF-32 (BE) (00 00 FE FF)

UTF-32 (LE) (FF FE 00 00)

David

Posted by Marc on 14-May-2013 09:34

Hello David,

Well, in one of my tests, OpenEdge added 4C 00 5C FA to the beginning of my file.

But this can change depending on the file I use...  (I also have once 4E 00 5E FA ...)

And it seems that OpenEdge try to make the file the same size, so 4 bytes are missing at the end of the file

What can I do with this ?!

Marc.

Posted by David Moloney on 14-May-2013 09:51

Not even the more obscure character sets use those values for a BOM so I

think that hunch can be eliminated.

BLOBs shouldn't be writing BOMs anyway - but it is the only value I

would expect to ever get prefixed to your data so it was worth asking.

I wonder if this is an address size issue. Do you get the same results

on 32 and 64 bit platforms?

David

Posted by Marc on 14-May-2013 10:33

I don't know, I have only 64 bits OS... windows 7 and linux for the database.

Posted by gus on 15-May-2013 09:08

are you using a BLOB or CLOB column to store the data file? You should use BLOB.

Posted by Marc on 15-May-2013 09:20

Hi Gus,

I actually use Blob data type...

Posted by gus on 15-May-2013 10:38

then there may be a bug. we should treat a BLOB as a bag of bits and not modify the data when reading from and writing to files.

Posted by Dileep Dasa on 16-May-2013 02:31

I tried the same thing with the same environment i.e., OE 11.0, database on Linux and with client on Win7 64 bit OS. There are no differences.

Posted by David Moloney on 16-May-2013 13:36

There have been core COPY-LOB changes in version 11 so I think it makes

sense to report this as a bug.

This thread is closed