SQL Built-In Functions and Stored Procedures: The i5/iSeries Programmer's Guide
Stored procedures and built-in functions can greatly expand the power and usefulness of SQL, but surprisingly these highly useful tools remain untapped by many programmers. For programmers who are new to the subject or those who want to expand on what they already know, this book provides an introduction to the creation and use of built-in functions and stored procedures under OS/400 and i5/OS. Programmers are lead through the development of custom-built functions for the programmer's own use, which includes editing numeric values for print with commas, decimal points, and currency symbols; returning the distance in miles between two zip codes; returning a running cumulative total for the data in the column; and converting date and currency to a text string. Each function includes code that can be used in the developer's own programs. Routine maintenance functions such as copying a file, rebuilding an existing table without losing the data in the existing table, building data files, modifying a library list, and compiling programs are also covered.