Questions about prime divisors. Let $Y$ be a prime divisor on $X$ and $\eta \in Y$ its generic point. Then the local ring $\mathcal{O}_{\eta, X}$ is a discrete valuation ring with quotient field $K$, the function field of $X$. This is in the last paragraph on page 130 of Hartshorne's book: algebraic geometry. I don't know how to prove this. I think that if $X$ is a curve, then $Y=\{\eta \}$ is a closed point. Therefore $\eta$ is a generic point of $Y$. But how could we prove that $\mathcal{O}_{\eta, X}$ is a discrete valuation ring? I think that we have to prove that $\dim \mathcal{O}_{\eta, X}=1$ since regular local ring with dimension 1 is a discrete valuation ring. Thank you very much.
 A: Let $X$ is covered by open affines $(U_i) $ where $U_i=Spec A_i$ . Let us say $\eta \in U_i=Spec A_i$ for some $i$. Claim :Now $\eta $ will correspond to some hieght 1 prime ideal of $Spec A_i$, let us say $\mathcal p$. Then $\mathcal O_{X,\eta}= \mathcal O_{U,\eta}=A_p$ Now dim $\mathcal O_{X,\eta}$ =dim$A_p =1$ .
Proof of the claim: Let us say $ht(p) \geq 2$ then there exists a prime ideal $p_1$ of $A_i$ such that $0 \subsetneq p_1 \subsetneq p $. It implies $\bar {p} \subsetneq \bar {(p_1)} \subsetneq \bar {(SpecA_i)}$. Now $\bar{p}=\bar{\eta}=Y$ and $\bar {Spec A_i}=X$ as X is irreducible and $Spec A_i$ is open in X. Which is contradiction to the fact that Y is o co-dimension 1.
Therefore, $\mathcal O_{X,\eta}$ is regular (because X is of co-dimension 1). So, $\mathcal O_{X,\eta}$ is a discrete valuation ring. (As, Noetherian regular local ring of dimension one is equivalent to saying that  the ring is discrete valuation ring.)
To see that $Q(\mathcal O_{X,\eta)}=K$.
$K=Q(A_i)$ by Exersice 3.6 of Chapter 2 and $Q(A_i)=Q(A_p)$ so it implies that $Q(\mathcal O_{X,\eta})=K$
