Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: perl DBI String length problem

by monkey_boy (Priest)
on Sep 06, 2005 at 16:21 UTC ( #489592=note: print w/replies, xml ) Need Help??

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;

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!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://489592]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2021-10-17 18:50 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (72 votes). Check out past polls.