Error while copying CLOB to file

Hi,

I'm trying to store a rather large CLOB (up to and above 40MB) into a file.

Currently I select the row containing the CLOB in a package function and call the function from my Delphi client to access the TLobLocator (using the Delphi wrapper generated by the DOA Package Wizard). Then in Delphi I try to use row.clobfield.SaveToFile to write the contents to a file.

SaveToFile always fails with "Stream read error". However, the returned TLobLocator in the row seems to be valid, at least the property row.clobfield.Size returns the correct size of the CLOB. This stream error is not only a problem of big CLOBs, it also happens with CLOBs of only 10K.

It kind of works when I use row.clobfield.AsString to access the CLOB, but it's obviously a bad idea for CLOBs with a size of several MB. With a 40 MB CLOB my client just quits in an instant without any error message...

So what's wrong here?

DOA 4.0.7.1 / Delphi 2006
Oracle OCI 9.2
Oracle9i Enterprise Edition Release 9.2.0.6.0

Frank
 
Strange. What happens if you process the data with TLOBLocator.Read? In a loop you can read the data and write it to the file, until you reach the end of the CLOB.
 
Originally posted by Marco Kalter:
Strange. What happens if you process the data with TLOBLocator.Read? In a loop you can read the data and write it to the file, until you reach the end of the CLOB.
Thanks, that's working perfect!

Frank
 
Back
Top