More work on inserting data into database.