'Umar b. al-Khattib reported Allah's Messenger (ﷺ) as saying
Allah, the Great and Majestic, forbids you to swear by your fathers. Umar said: By Allah. I have never sworn (by my father) since I heard Allah's Messenger (ﷺ) forbidding it mentioning them" on my behalf" nor on behalf of someone else.
This hadith has been transmitted on the authority of Zuhri except that in the hadith narrated on the authority of Uqail the words are
" I did not take oath by (anyone else except Allah) since I heard Allah's Messenger forbidding it. nor did I speak in such terms, and the narrator did not say," on my own behalf or on behalf of someone else".
Salim reported on the authority of his father that Allah's Apostle (ﷺ) heard 'Umar while he was taking oath by his father. The rest of the hadith is the same.
'Abdullah (b. Umar) reported that Allah's Messenger (ﷺ) found, Umar b. al-Khattab amongst the riders and he was taking oath by his father Allah's Messenger (ﷺ) called them (saying) ; Our Allah, the Exated and Majestic, has forbidden you that you take oath by your father. He who bag to take an oath, he must take it by Allah or keep quiet.
This hadith is narrated on the authority of Ibn Umar through another chain of transmitters.
Ibn 'Umar heard Allah's Messenger (ﷺ) as saying
He who has to take an oath, he must not take oath but by Allah. The Quraish used to take oath by their fathers. So he (the Holy Prophet) said: Do not take oath by your fathers.