In my previous post, Creating User Defined Functions to make my SQL statements easier, I gave example of how to create SQL User Defined Functions, UDF, using RPG. In this post I am going to show how I can create an UDF made up entirely of SQL.
I have created this UDF to concatenate the parts of the employee's name together. My example Employee Master file, EMPMST, has the following fields:
A R EMPMSTR A LASTNME 30A A FIRSTNME 20A A MIDINITL 1A
When I look in the file I see: