


With the DB functions, SQL-PL allows the effects of the SQL statements to be extended by user-specific functions. A DB function is defined by a database user and is available to all the other database users without defining execute privileges. A DB function can be used within the SELECT statement either in the SELECT list or in the WHERE qualification.
An SQL-PL module is declared to be a DB function by the keyword DBFUNC. In the database, it is only activated by using the menu item 'The Menu Item 'Object'' (see The Workbench chapter, sections The Menu Item 'Object' or Commands, FCREATE. When doing so, the DB function is assigned a name which must be unique within the database. A DB function created has the status '->DB' in the module list.
Restrictions for DB functions are described in the subchapter of this chapter having the same name.
Example: Definition of a DB Function

Example: Defining the DB Function in the Workbench

Example: Using the DB Function

Example: Result of the SELECT Statement

Syntax:



