my $sth = $dbh->prepare( 'INSERT INTO table(' . join(',', keys %$c) . ") VALUES (" . chop(join('', map {'?,'} keys %$c)) . ")" );