Execute an external function with the RETURN statement

You can use a RETURN statement to execute any external function from within an SPL routine. The following figure shows an external function that is used in the RETURN statement of an SPL program.
Figure 1: A RETURN statement to execute an external function from within an SPL routine.
CREATE FUNCTION c_func() RETURNS int
LANGUAGE C;

CREATE FUNCTION spl_func() RETURNS INT;
   RETURN(c_func());
END FUNCTION;

EXECUTE FUNCTION spl_func();

When you execute the spl_func() function, the c_func() function is invoked, and the SPL function returns the value that the external function returns.