Let $X$ be an irreducible nonsingular algebraic variety. Let $Y$ be an irreducible codimension 1 closed subvariety. An important theorem states that locally $Y$ is cut out by a single equation regular in the neighborhood of a given point. What would be an example where this is not true globally?
In other words,
What is an example of $X,Y$ as above in which no rational function on $X$ has precisely $Y$ as a zero set?
(If $X$ is affine and $k[X]$ is a UFD then $Y$ is always globally cut out by one equation. Similarly if $X$ is projective and the homogeneous coordinate ring is a UFD. So I know I need a failure of unique factorization to get the example I want. That said, so far I haven't constructed it, so I humbly turn to your assistance.)