refactor common insert-statement, and make null value binding work