in reply to perl mysql - INSERT INTO, 157 columns

Google "perl insert many columns": Stack Overflow: insert 1 row with a lot of columns using an array in Perl DBI

  • Comment on Re: perl mysql - INSERT INTO, 157 columns

Replies are listed 'Best First'.
Re^2: perl mysql - INSERT INTO, 157 columns
by ler224 (Acolyte) on May 01, 2014 at 21:05 UTC
    Would I still need to list all of the column names?
    my $placeholders = join ", ", ("?") x @array; $sth->prepare("insert into bigtable (col...) values ($placeholders)"); $sth->execute(@array);

      From here:

      If you do not specify a list of column names for INSERT ... VALUES or INSERT ... SELECT, values for every column in the table must be provided by the VALUES list or the SELECT statement.