apache > db
Apache DB Project
 
Font size:      

fn

fn

The fn keyword allows the use of several scalar functions. The function name follows the keyword fn.

Syntax

{fn functionCall}

where functionCall is one of the following functions:


concat (CharacterExpression, CharacterExpression)

Character string formed by appending the second string to the first; if either string is null, the result is NULL. {fn concat (CharacterExpression, CharacterExpression) is equivalent to built-in syntax { CharacterExpression || CharacterExpression }. For more details, see Concatenation.


sqrt (FloatingPointExpression)

Square root of floating point number.

{fn sqrt (FloatingPointExpression)} is equivalent to built-in syntax SQRT(FloatingPointExpression). For more details see SQRT.


abs (NumericExpression)

Absolute value of number. {fn abs(NumericExpression)} is equivalent to built-in syntax ABSOLUTE(NumericExpression). For more details see ABS or ABSVAL.


locate(CharacterExpression,CharacterExpression [, startIndex] )

Position in the second CharacterExpression of the first occurrence of the first CharacterExpression, searching from the beginning of the second character expression, unless startIndex is specified. {fn locate(CharacterExpression,CharacterExpression [, startIndex] )} is equivalent to the built-in syntax LOCATE(CharacterExpression, CharacterExpression [, StartPosition] ). For more details see LOCATE.


substring(CharacterExpression, startIndex, length)

A character string formed by extracting length characters from the CharacterExpression beginning at startIndex; the index starts with 1.


mod(integer_type, integer_type)

MOD returns the remainder (modulus) of argument 1 divided by argument 2. The result is negative only if argument 1 is negative. For more details, see MOD.

Note:
Any Derby built-in function is allowed in this syntax, not just those listed in this section.

Previous Page
Next Page
Table of Contents
Index