There are a lot of questions and issues with regards to user defined functions (UDFs) that were introduced in Pega 6.2sp2. While there are existing articles on different parts of this topic here is an attempt to cover the topic altoghether and link in relevant articles.
This article explains what user-defined functions (UDFs) are and when to use them. The sections on UDF use and installation apply to all databases. The sections on troubleshooting UDF issues pertain to Oracle.
While this article primarily addresses user needs with Pega 7.2.x, you can use most of the information if you are using any Pega 7.1.x release and some of the information if you are using a PRPC 6.x release.