Is every invertible rational function of order 0 on a codim 1 subvariety in the local ring of the subvariety? I have been trying to read Fulton's Intersection Theory, and the following puzzles me.
All schemes below are algebraic over some field $k$ in the sense that they come together with a morphism of finte type to $Spec k$.
Let $X$ be a variety (reduced irreducible scheme), and let $Y$ be a codimension $1$ subvariety, and let $A$ be its local ring (in particular a $1$-dimensional Noetherian local domain). Let $K(X)$ be the ring of rational functions on $X$ (the local ring at the generic point of X). Let $K(X)^*$ be the abelian group (under multiplication) of units of $K(X)$, and $A^*$ -- the group of units of $A$.
On the one hand, for any $r\in K(X)^*$ define the order of vanishing of $r$ at $Y$ to be $ord_Y(r)=l_A(A/(a))-l_A(A/(b))$ where $r=a/b$ for $a$ and $b$, and $l_A(M)$ is the length of an $A$-module $M$. On the other hand, it turns out that $Y$ is in the support of the principal Cartier divisor $div(r)$ if and only if $r\not\in A^*\subset K(X)^*$.
It is obvious that $Y$ not in the support of $div(r)$ implies that $ord_r(Y)=0$, since the former claims that $r\in A^*$ from which it follows that $ord_Y(b)=ord_Y(rb)=ord_Y(a)$ since obviously $ord_Y(r)=0$ for any unit. The contrapositive states that $ord_r(Y)\neq0$ implies $Y$ is in the support of $div(r)$. Because the latter can be shown to be a proper closed set and thus containing finitely many codim. $1$ subvarieties, which shows that the associated Weyl divisor $[D]=\sum_Y ord_Y(r)[Y]$ is well-defined.
What is not clear to me is whether or not the converse is true, i.e. whether $Y$ in the support of $div(r)$ implies that $ord_Y(r)\neq0$. I find myself doubting since if I am not mistaken, this is equivalent to the statement $l_A(A/(a))=l_A(A/(b))$ if and only if $(a)=(b)$, where $A$ is any $1$-dimensional local Noetherian domain (maybe even a $k$-algebra) which seems much too strong. Any (geometric) examples to give me an idea of what is going would be much appreciated.

The support of a Cartier divisor $D$ on $X$ is the union of all closed subvarieties $Z\subset X$ such that the local equation of $D$ at the generic point $z$ of $Z$ is not a unit of the local ring $O_{X,z}$. Note that $Z$ can be of codimension $>1$. However, let $f_Z$ be the local equation of $D$ and let $p\in\mathrm{Spec}(O_{X,z})$ such that $f_ZO_{X,z}\subseteq p$ and $p$ is minimal with that property. Then by the Principal Ideal Theorem $p$ is of height $1$ and $f_Z$ is not a unit in the localization $(O_{X,z})_p$. The latter is the local ring of the codimenions $1$ subvariety $Y$ having $p$ as its generic point. This shows that if $Z$ is in the support of $D$, then every codimension $1$ subvariety $Y\subset X$ such that $Z\subseteq Y$ is in the support of $D$. Does this solve your problem?
