- or download this
my $sql= new SQL::Abstract( array_datatypes => 1 );
my $required = { a => [1, 3, 5], b => [2, 4, 6],};
my($stmt, @bind)= $sql->insert( testtable => $required );
- or download this
stmt: "INSERT INTO testtable ( a, b) VALUES ( ?, ? )"
@bind: (
...
6
]
);
- or download this
my $data = [
{a => 1, b => 2},
{a => 3, b => 4},
{a => 5, b => 6},
];
- or download this
# %columns will become the hash of arrays
my %columns;
...
# push the value foreach column
push @{$columns{$_}}, $row->{$_} foreach keys %columns;
}