SQL Database: Roughly implement set_fields_if_empty.