The Gemorah in Beitzah 4a says that Rav wouldn't give a drasha on Yom Tov after eating the seudah because when he would give a drasha he would be moreh halacha (give over halachic rulings) and this is ossur to do when one is drunk.
(This is based on the Gemorah there at the bottom of the page and what Rashi says.)
Is this idea (or "issur" of not paskening halachos when one is drunk -- and not only this story like someone has already pointed out) brought anywhere in Shulchan Aruch? What about in the Rambam? More importantly though I'm curious to know if this is brought anywhere in Shulchan Aruch. And if it's not, then why?