EMS logo

Products Navigation

SQL Manager for Oracle

Our Partnership Status

Microsoft Certified Partner
Oracle Certified Partner
Embarcadero Technology Partner

EMS SQL Manager for Oracle

On-line Documentation

Functions


A stored function (also called a user function or user-defined function) is a set of PL/SQL statements you can call by name. Stored functions are very similar to procedures, except that a function returns a value to the environment in which it is called. User functions can be used as part of a SQL expression.

 

 

Creating Functions

 

To create a new function:

Hint: To create a new function, you can also right-click the Functions node or any object within this node in the DB Explorer tree and select the New Function item from the context menu.

 

To create a new function with the same properties as one of existing functions has:

Alternatively, you can right-click a function in the DB Explorer tree and select the Duplicate Function <function_name>... context menu item.

 

Duplicate Object Wizard allows you to select the database to create a new function in, and to edit the result SQL statement for creating the function.

 

 

Editing Functions

 

To edit an existing function:

  • select the function for editing in the DB Explorer tree (type the first letters of the function name for quick search);
  • right-click the object and select the Edit Function <function_name> context menu item, or simply double-click the function;
  • edit function definition using the appropriate tabs of Function Editor.

 

Dropping Functions

 

To drop a function:

  • select the function to drop in the DB Explorer tree;
  • right-click the object and select the Drop Function <function_name>... context menu item;
  • confirm dropping in the dialog window.

 

Note: If more convenient, you can also use the following shortcuts:

Ctrl+N to create a new function;

Ctrl+O to edit the selected function;

Shift+Del to drop the object from the database.