Simple functions

A function in a qualification tests the contents of a column against a specified value.

For example, in the following SELECT statement, the function tests whether the value in the lname column is the character string SMITH:
SELECT lname, fname, customer_num from customer 
WHERE lname = "SMITH"
In the preceding example, the equal operator (=) represents the function equal() and has two arguments, a column name and a string constant. The following formats apply to simple qualification functions.
Table 1. Generic function prototypes
Generic prototype Description
function(column_name) Evaluates the contents of the named column
function(column_name, constant) function(constant, column_name) Evaluates the contents of the named column and the explicit value of the constant argument In a commuted argument list, the constant value precedes the column name.
function(column ?) Evaluates the value in the specified column of the current row and a value, called a host variable, that a client program supplies
function(column, slv #) Evaluates the value in the specified column of the current row and a value, called a statement-local variable (SLV), that the UDR supplies
function(column, constant, slv #) function(constant, column, slv #) Evaluates the value in the specified column of the current row, an explicit constant argument, and an SLV