INFORMIX
Extending Informix-Universal Server: Data Types
Chapter 2: Extending an Operation
Home Contents Index Master Index New Book

How Do You Extend an Operation?

The property called routine overloading allows you to create a user-defined function whose name is already defined in the database but whose parameter list is different. All functions with the same name have the same functionality, but they operate on different data types. Universal Server uses routine resolution to determine which function to execute, based on the data types of the arguments for the function. For more information on routine overloading and routine resolution, see Chapter 1 of Extending INFORMIX-Universal Server: User-Defined Routines.

You can extend an operation on:

On Existing Data Types

The data type system of Universal Server defines operations on the data types that it provides. (For a summary of these data types, see "Data Types That Universal Server Provides".) To provide additional functionality in your database, you can write end-user routines, which end users can include in their SQL statements.

Tip: You cannot redefine the operator functions, built-in functions, or aggregate functions on the existing data types.
You can write these end-user routines in either of the following languages:

Once you have written the end-user routines, register them in the database. Use the CREATE FUNCTION statement to register end-user functions and the CREATE PROCEDURE statement to register end-user procedures. You must also use the GRANT statement to grant the Execute privilege to those users who have permission to call the end-user routines.

For more information on how to write an end-user routine, see Extending INFORMIX-Universal Server: User-Defined Routines.

On Extended Data Types

The extensible data type system of Universal Server allows you to define operations on extended data types. (For a summary of these data types, see "Data Types That You Provide".) To provide additional functionality in your database, you can create user-defined functions to support the following types of operations on an extended data type:

    Figure 2-7 lists the built-in functions that you can overload.

Tip: You cannot redefine the aggregate functions to handle extended data types.
For more information on how to provide these operations for an opaque data type, see "Creating SQL-Invoked Functions".




Extending Informix-Universal Server: Data Types, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.