Add function to record the database name for dealing with INSERT statement