Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

EXECUTE FUNCTION

Use the EXECUTE FUNCTION statement to execute a user-defined function.

This statement is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-EXECUTE FUNCTION--------------------------------------------->
 
                                                                          (3)  (1) (4)
>--+-+-function-------+--(--+-----------------------+--)--| INTO Clause |---------------+-><
   | |  (1)           |     | .-,-----------------. |                                   |
   | '--------SPL_var-'     | V              (2)  | |                                   |
   |                        '---| Argument |------+-'                                   |
   |  (5)    (6)                                   (7)                                  |
   +---------------| IFX_REPLACE_MODULE Function |--------------------------------------+
   |  (5)    (8)                           (9)                                          |
   '---------------| jvpcontrol Function |----------------------------------------------'
 
Notes:
  1. Stored Procedure Language only
  2. See Arguments
  3. See INTO Clause
  4. ESQL/C only
  5. Dynamic Server only
  6. C only
  7. See IFX_REPLACE_MODULE Function (IDS, C)
  8. Java only
  9. See The jvpcontrol Function (Java)
Element Description Restrictions Syntax
function Name of a user-defined function to execute Must be registered in the database Database Object Name
SPL_var Variable that contains the name of an SPL routine to be executed Must be a CHAR, VARCHAR, NCHAR, or NVARCHAR data type that contains the non-NULL name of an existing SPL function Identifier

Usage

The EXECUTE FUNCTION statement invokes a user-defined function (UDF), with arguments, and specifies where the results are to be returned.

An external function returns exactly one value.

An SPL function can return one or more values.

You cannot use the EXECUTE FUNCTION statement to execute any type of user-defined procedure that returns no value. Instead, use the EXECUTE PROCEDURE or EXECUTE ROUTINE statement to execute procedures.

You must have the Execute privilege on the user-defined function.

If a UDF has a companion function, any user who executes the function must have the Execute privilege on both the function and its companion. For example, if a function has a negator function, any user who executes the function must have the Execute privilege on both the function and its negator.

For more information, see GRANT.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]