Home | Previous Page | Next Page   Creating and Using SPL Routines > Executing Routines >

Executing an External Function with the RETURN Statement

You can use a RETURN statement to execute any external function from within an SPL routine.*** Figure 462 shows an external function that is used in the RETURN statement of an SPL program.

Figure 462.
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.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]