Make an SQL UDF Return Null
August 14, 2002 Timothy Prickett Morgan
Hey, Ted:
In the October 19, 2001 Midrange Guru, OS/400 Edition, you showed how to use an RPG subprocedure in a service program as an SQL user-defined function. Can you tell me how to write a similar function that can return a null value?
|
— Marty
The key to returning a null value is in the parameter style (the parameter-passing convention) that you use. I like the SQL convention, but there are others that will work.
The SQL convention passes the following parameters:
- All of the input parameters specified in the create function SQL command
- The output parameter