End-user routines

The database server allows you to define SQL-invoked functions or procedures that the end user can use in expressions or SQL statements. These end-user routines provide additional functionality that an end user might need to work with the opaque data type. Examples of end-user routines include:
  • Functions that return a particular value in the opaque data type

    Because the opaque data type is encapsulated, an end-user function is the only way that users can access fields of the internal structure.

  • Cast functions

    Several of the support functions serve as cast functions between basic data types that the database server uses. You might also write additional cast functions between the opaque data type and other data types (built-in, opaque, or complex) of the database.

  • Functions or procedures that perform common operations on the opaque data type

    If an operation or task is performed often on the opaque data type, you might want to write an end-user routine to perform this task.

For more information about end-user routines, see Develop a user-defined routine.