Creating Functions Using SQL Explorer

To create a user-defined function:

  1. In the context tree, select the schema that you want the new function to be in.
  2. In the Database Hierarchy menubar, click (New) | Function. SQL Explorer opens a query tab and populates it with a skeleton function:
  3. SET DELIMITER @
    CREATE FUNCTION FUNCTION1 (p1 STRING)
         RETURNS STRING
         DETERMINISTIC
         LANGUAGE SQL
    AS
        RETURN p1;
    END_FUNCTION
    @
  4. Modify this as needed and then click Execute in the menubar to save the function.

For more information about user-defined functions, see CREATE FUNCTION.To cancel the addition of a function, close the tab in which you are defining the function with clicking Execute.