You sure it is cast iron? The only cast iron flanges for PVC pipe use either a clamp or a compression fitting to hold them to the pipe. Depending on the brand, you might just twist it out, or you may have to back off on some screws to loosen the clamp (often this clamp is internal). Now, if it is plain painted steel ring on a solvent welded toilet flange, they do make repair rings. You cut or pry the old one off, and the new replacement is hinged and fits into the groove, then you screw it to the floor, which holds it in place. A picture would help.