Updating cursor with multiple tables