my $qs = 'insert into Promotions (' . join(',', keys %{$hash->{promotion}} ) . ',Date_Created,Date_Modified) values (' . join(',', ('?') x scalar( keys %{$hash->{promotion}} ) ) . ',SYSDATE,SYSDATE)'; $sth = $dbh->prepare( $qs ); $sth->execute( @{$hash->{promotion}}{ keys %{$hash->{promotion}} } );