in reply to perl DBI String length problem

I think you are checking the wrong error, this is a statement-handle method, not a database-handle method, try:

$inserthandle->execute or die $inserthandle->errstr;

*UPDATE*
You could also check the quoting is correct:
my $inserthandle = $dbh->prepare(" INSERT INTO CHIPDATA (RawData) VALUES (". $dbh->quote($longstring) .") ");


This is not a Signature...

Replies are listed 'Best First'.
Re^2: perl DBI String length problem
by travisbickle34 (Beadle) on Sep 07, 2005 at 07:59 UTC
    I have opened the connection to the database prior to the subroutine shown here so that is not a problem.

    I tried the other suggestions too i.e. the quoting and the $inserthandle->errstr suggestion but neither make any difference. By doing $inserthandle->execute or die $! I get the error connection reset by peer.
      In fact, I've just attempted the same thing directly through mysql and it also dies when I increase the string length from 1000,000 chars to 1100,000 chars. Not DBI's fault after all!
        It turns out mysql's "max_allowed_packet" default setting is 1048576. Problem solved!