At risk of paraphrasing Jeremy Schneider (and maybe others) on this one: Q: Is there a better way to code this? A: Yes. Q: Is it an easy code fix? A: Yes, since the function is abstracted from the application. Q: Is it necessary to use the built-in SUBSTR vs the UDF? A: Probably not. Bottom line: Unless one requires fractional seconds to meet the performance target on this, it's probably not worth the effort of change. However, it's always worth the opportunity to educate developers on what the desired way to solve this problem. Use it as a learning experience and go chase some big performance fish... -- Regards, Greg Rahn http://structureddata.org -- //www.freelists.org/webpage/oracle-l