O'Reilly logo

The Programmer’s Guide to iSeries Navigator by Paul Touhy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

User-Defined Functions

Perhaps the easiest way to see how a UDF is implemented is through an example. Here, we will look at examples of both External and SQL functions.

Figure 7.1 shows the contents of the table NUMBERDATE. Only one numeric column (DATEISO) is present in the table, and it contains dates stored as numbers in ISO format—that is, the number 20050514 is actually 14 May 2005. I think that this is a scenario that most of us are familiar with, since it is how dates have been traditionally stored on our databases.

Figure 7.1. Contents of the table NUMBERDATE.

Handling numbers as dates is not an issue when accessing the table from within ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required