informix
Extending Informix Dynamic Server 2000
Extending an Operation

Built-In Functions

The database server provides special SQL-invoked functions, called built-in functions, that provide some basic mathematical operations.

Built-In Functions That You Can Overload

Figure 6-4 shows the built-in functions that you can overload.

Figure 6-4
Built-In Functions That You Can Overload

Built-In Function Number of Parameters Parameter Types
abs() 1 Real number
mod() 2 Integer-number expression, integer-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-number expression
cos(), sin(), tan() 1 Numeric expression
acos(), asin(), atan() 1 numeric expression
atan2() 2 Numeric expression,
numeric expression
hex() 1 Integer expression
length(), char_length(), character_length(), octet_length() 1 Character string
extend() 1 Date/time expression

Built-In Functions That You Cannot Overload

The following table lists the built-in functions that you cannot overload.

cardinality() day() month() user
current dbinfo() sitename weekday()
date() dbservername today year()
datetime() mdy() trim()

Tip: Technically, CURRENT, DBSERVERNAME, SITENAME, TODAY, and USER, are not built-in functions, but built-in macros. You can register overloaded routines by those names, but you cannot use them in SQL statements.

The following table lists the built-in functions for the Optical Subsystem that you cannot overload.

descr() volume()
family()

Overloading a Built-In Function

The database server provides versions of the built-in functions that handle the built-in data types. You can write a new version of a built-in function to allow the function to operate on your new opaque data type. If you write a new version of a built-in function, follow these rules:

For more information on the built-in functions, see the Expression segment in the Informix Guide to SQL: Syntax.


Extending Informix Dynamic Server 2000, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved