There is a Linux program called banner that generates ASCII art from any text feeding to it.
Just realize that the system() function is not highly portable, so it is not ideal for writing info to file for debugging or logging purpose (like what I’ve done when debugging the DB2 external scalar function).
The stdlib.h header file contains definition of system() function, which you can use to run a system command from within program written in C Language.
After learning how to build DB2 external UDF in the previous post, now let’s see how to make the user-defined function writing debugging info to your own application log file (not the DB2 system log file).
The IBM DB2 allows one to create external user-defined function (UDF) in few of the popular programming languages. In this tutorial, however, the focus is on using C Language to build an external scalar function that convert UNIX epoch time to calendar date.
The DB2 SQL scalar function created in previous post is almost perfect, except that it cannot resolve the UTC date/time to local time zone.
The IBM DB2 doesn’t provide a native SQL function to convert UNIX epoch time to human-readable calendar date/time format.