On 11/9/06, Bart Lateur <[EMAIL PROTECTED]> wrote:
On Wed, 8 Nov 2006 23:26:02 -0800, Jonathan Leffler wrote: > Bart Lateur <[EMAIL PROTECTED]> asked: >>And 2), in a fetch loop, is it possible to adjust a property like >> {ReadLongLen}, and retry the same fetch without restarting the whole >> loop? Because this error typically happened several minutes into the >> loop. > >Highly unlikely. The data has been fetched - and truncated. There's not >usually a way to refetch the same row - unless you have a scroll cursor, and >DBI doesn't have support for those. I can see that. Well I'm thinking of the following solution next: retrieve extra data to identify the row that went wrong and collect them, keep going on with the rest of the records, and individually fetch the previously failed ones afterwards. After a failure, I can go on with the next records, can't I? And changing ReadLongLen, is that acceptable for the remainder of the loop?
That works - I've used it in (non-Perl) code for aeons (dating back to 1986). The primary demerits are (1) two fetches for each row, and (2) establishing the unique identifier column or columns for the data. And yes, I can think of no reason why a driver that honours ReadLongLen would not adapt to changed values as the loop continues. Since DBD::Informix doesn't pay attention to ReadLongLen in the first place, it isn't much use looking at that code - and other driver writers would have to answer for their code. -- Jonathan Leffler <[EMAIL PROTECTED]> #include <disclaimer.h> Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org "I don't suffer from insanity - I enjoy every minute of it."