INFORMIX
Extending INFORMIX-Universal Server: User-Defined Routines
Chapter 2: Routine Overloading and Routine Resolution
Home Contents Index Master Index New Book

Built-In SQL Functions That You Can Overload

Universal Server provides special built-in SQL functions that provide some basic mathematical operations. You can overload most built-in SQL functions. For example, you might want to create a sin() function on a new data type that represents complex numbers.

Figure 2-7 provides the full list of built-in SQL functions that you can overload. A user might create a function with the same name as one from this table, but its routine signature must be unique in the database (non-ANSI) or the schema (ANSI). For more information on a routine signature, refer to "The Routine Signature".

Figure 2-7
Built-In SQL Functions That You Can Overload

(1 of 2)

Built-In SQL
Function Names
Number of
Parameters
Parameter Types

abs()

1

real number

mod()

2

real number expression,
real number expression

pow()

2

real number expression,
real number expression

root()

1 or 2

real number expression
[, real number expression]

round()

1 or 2

expression, [literal integer]

sqrt()

1

real number expression

trunc()

1 or 2

expression, literal integer

exp(), log(), logn()

1

positive real expression

cos(), sin(),tan()

1

numeric expression

asin(), acos(), atan()

1

numeric expression

atan2

2

numeric expression,
numeric expression

length(), octet_length(), char_length(), character_length()

1

character string

These built-in SQL functions appear as UDRs and have entries in the sysprocedures system catalog table. The language for these entries are C or BUILTIN, depending on the internal implementation. Informix strongly recommends that you do not update or delete these entries.

Universal Server does not handle the following built-in SQL functions as UDRs. Therefore, you cannot overload these built-in SQL functions:

In general, Universal Server does not treat these functions as UDRs because the syntax that you use to call them does not conform to the syntax that you use to invoke UDRs.




Extending INFORMIX-Universal Server: User-Defined Routines, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.