Divisors in codimension 1 projective varieties Let $X\subseteq \mathbb{P}^n(\mathbb{C})$ be a smooth irreducible variety. Suppose you have an irreducible subvariety $Y\subseteq X$ of dimension $dim(X)-1$. Under which hypothesis can I assure that there is a $f\in \mathbb{C}[x_1,\dots,x_{n+1}]$ such that $V(f)\cap X=Y$?
I know that the condition holds, for example, when $\mathbb{C}[X]$ is a UFD. Is there a weaker condition?
 A: a) A necessary condition for the answer to be yes for all effective divisors is that $X$ be projectively normal:  Hartshorne, Chapter II, Exercise 5.14.       
b) A vast class of examples of projectively normal varieties are the complete intersections: Hartshorne, Chapter II, Exercise 8.4.  
c) A necessary and sufficient condition for the answer to be yes for all effective divisors $Y\subset X$ is that the the homogeneous coordinate ring $S(X)$ of $X$ be factorial:  Hartshorne, Chapter II, Exercise 6.3.(c).
d) The simplest example of a divisor  $Y\subset X$ that can't be written as $Y=V(f)\cap X$ can be found  on  the conic $X=V(X_0^2-X_1X_2\}\subset \mathbb P^2_\mathbb C$:
The  effective divisor $Y=\{P\}\subset X$ consisting of a single point $P\in X$ can't be of the form $V(f)\cap X$ with $f\in \mathbb C[X_0,X_1,X_2] $ homogeneous of degree $d$,  since such a divisor has degree $2d$ and $2d\neq1=\operatorname {deg}Y$.
Note that the conic $X$ is projectively normal (since it is a complete intersection) but its homogeneous coordinate ring $S(X)= \frac {\mathbb C[X_0,X_1,X_2]}{\langle X_0^2-X_1X_2\rangle }=\mathbb C[x_0,x_1,x_2]$ is not factorial since the equality $x_0^2=x_1x_2$ exhibits distinct factorizations of the same element into irreducibles.
