my $dbh = DBI->connect($data_source, $opts...); my $update_stmt = $dbh->prepare("UPDATE tbl_name SET `CUSTOMER NAME` = ?, AGE = ?, STATUS = ?, ..."); ... $update_stmt->execute( defined $customer_name ? $customer_name : undef, defined $age ? $age : undef, defined $status ? $status : undef, ...);