RPG User Defined Functions & Table Functions
RPG is the best language in the world for writing business rules. But what happens when you want to use those business rules from SQL? Or from a web application that accesses your business logic through SQL? DB2 for i lets you write User Defined Functions (UDFs) in high level languages like RPG. UDFs can be called from SQL statements run from anywhere, including ad-hoc queries, SQL run from web applications, and SQL run from the embedded SQL precompilers used by RPG and other languages.
UDFs can even return a table (often called a UDTF, User Defined Table Function) which lets them do the same sort of work that a stored procedure would do -- but unlike stored procedures, they can return result sets to any language, including PHP, Java, .NET and embedded SQL written in ILE RPG.
UDFs are a powerful tool for any programmer's toolbox.
Click here to download a handout for this presentation
Click Here For More Information and Code Downloads