Fix SQL error on insert