Why witness has to take an oath in Judicial Proceedings?

Why witness has to take an oath in Judicial Proceedings?