Declaring Variables as the PROCEDURE Type
The PROCEDURE keyword indicates that in the current scope, the variable is a call to a UDR.
The DEFINE statement does not support a FUNCTION keyword. Use the PROCEDURE keyword, whether you are calling a user-defined procedure or a user-defined function.
DEFINE length PROCEDURE; ... LET x = length (a,b,c)
This definition disables the built-in LENGTH function within the scope of the statement block. You would use such a definition if you had already created a user-defined routine with the name length.
If you create an SPL routine with the same name as an aggregate function (SUM, MAX, MIN, AVG, COUNT) or with the name extend, you must qualify the routine name with the owner name.