Thanks for the info. I'll fix it for the next release (don't ask).

Tim.

On Sun, Jan 28, 2001 at 07:19:01PM +0200, Margarita Zlotnikov wrote:
> Hi Tim,
> 
> We were trying to use DBD::Oracle (v. 1.06) for reading CLOBs, and we 
> were getting an error message of the type:
> 
> DBD::Oracle::st fetch failed: ORA-01403: no data found (DBD NEED_DATA: 
> OCILobRead) at ../lib/per
> l/Dictionary/EntryDictionary.pm line 79.
> ORA-01403: no data found (DBD NEED_DATA: OCILobRead)
> 
> We took a look at the DBD::Oracle source code (specifically, the 
> fetch_func_autolob() function in oci8.c) and in the OCI documentation, 
> and found the following:
> Our database is configured to use UTF-8. Therfore the buffer size needed 
> to accomodate an n-charachter string is (potentially) n*3, since each 
> character might take up to 3 bytes. OCILobGetLength() returns the length 
> of the LOB in characters. On the other hand, the buflen parameter to 
> OCILobRead is in bytes. Therefore using loblen to determine buflen 
> (oci8.c lines 539-540) is wrong. Moreover, according to the OCI 
> documentation (and to our experience), even if you do give a buffer 
> which is long enough (3 times loblen), OCILobRead() might still fill 
> only part of it, and return OCI_NEED_DATA (expecting you to call it again).
> 
> We "fixed" the problem by simply setting buflen to imp_sth->long_readlen 
> - regardless of what OCILobGetLength() returnes. However this is 
> probably not an adiquate solution. You might want to look into it and 
> come up with a proper solution for your next release.
> 
> Thanx,
> 
> Rita Zlotnikov & Uri Bernstein
> Atomica Corporation
> www.atomica.com

Reply via email to