Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Other Syntax Segments > Routine Modifier >

VARIANT and NOT VARIANT

Use the VARIANT and NOT VARIANT modifiers with C user-defined functions and SPL functions. A function is variant if it returns different results when it is invoked with the same arguments or if it modifies a database or variable state. For example, a function that returns the current date or time is a variant function.

By default, user-defined functions are variant. If you specify NOT VARIANT when you create or modify a user-defined function, the function cannot contain any SQL statements.

If the user-defined function is nonvariant, the database server might cache the returned values of expensive functions. You can create functional indexes only on nonvariant functions. For more information on functional indexes, see CREATE INDEX.

In ESQL/C, you can specify VARIANT or NOT VARIANT in this clause or in the EXTERNAL Routine Reference. For more information, see External Routine Reference. If you specify the modifier in both places, however, you must use the same modifier in both clauses.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]