in reply to Re: DBI SQL adding array of values
in thread DBI SQL adding array of values

If still get a "26 values when 25 are expected" error, try using $sth->execute( undef,@data )
Um, no, don't do that. It will almost guarantee that the data will get placed in the wrong columns. Undef should be the first value in $dbh->do() because it is an attribute, not part of the data, but execute() doesn't currently take an attribute so it will become a value and shift all the other values to the right.

Replies are listed 'Best First'.
Re^3: DBI SQL adding array of values
by radiantmatrix (Parson) on Oct 27, 2004 at 18:16 UTC
    That is exactly the point. Adding the undef is a debugging step the OP was trying to use, but using the wrong function to do it. It allows you to get an idea of what data is actually being passed to the DBI call without resorting to tracing.

    It's a good quick debug, and I (and the OP) was perfectly aware of the outcome.

    radiantmatrix
    require General::Disclaimer;
    "Users are evil. All users are evil. Do not trust them. Perl specifically offers the -T switch because it knows users are evil." - japhy