Before entering upon the duties of the office, the city attorney shall take the oath prescribed by this Code or other law for city officers.