A solenoid bent into the form of a closed ring is called a toroidal solenoid.
Note: The magnetic field exists only in the tubular area bound by the coil and it does not exist in the area inside and outside the toroid.
i.e. B is zero at O and Q and non-zero at P.