11. Report-Writer Expressions and Formats : Operations : Built-in Functions
 
Share this page                  
Built-in Functions
You denote a function by a function name, followed by an operand (or two operands) in parentheses. When valid expressions are substituted for the operands, the result itself is an expression that evaluates to a number, string, or date.
The resulting expression assumes the default print format appropriate for that type of expression (number, string, or date), as described in . For example, if you specify the following:
.print uppercase(column1)
The expression, uppercase(column1), evaluates to a string. When printing the string, Report-Writer uses the default format for strings (c0), not the format for the specified column. If you want to print the resulting expression in a format other than the default for number, string, or date, specify the format explicitly in a .print or .format statement; for example:
.print uppercase(column1) (cf30.6)
A faster and more efficient way to unconditionally print the column value in uppercase for all retrieved rows would be:
select uppercase(column1) as column_a
.format column_a (cf30.6)
.print column_a
You can nest functions to any level.
All of the Ingres conversion, numeric, string, and date functions are syntactically allowed in the .cleanup, .query, and .setup statements. For all other Report-Writer statements the following table lists the supported functions. To determine if a function is appropriate for use in a particular context within Report-Writer, see its description in the SQL Reference Guide, or if you are using an Enterprise Access product, the OpenSQL Reference Guide.
The following table lists the built-in functions:
Conversion
Numeric
String
Date
c(expr)
abs(n)
charextract
(c1,n)
date_gmt
(date)
char(expr)
atan(n)
concat(c1,c2)
date_part
(unit,date)_
date(expr)
cos(n)
left(c1,len)
date_trunc
(unit,date)_
dow(expr)
exp(n)
length(c1)
interval
(unit,date_interval)_
float4(expr)
log(n)
locate(c1,c2)
_date(s)
float8(expr)
mod(n,b)
lowercase(c1)
_time(s)
hex(expr)
sin(n)
pad(c1)
 
int1(expr)
sqrt(n)
right(c1,len)
 
int2(expr)
 
shift(c1,nshift)
 
int4(expr)
 
size(c1)
 
money(expr)
 
squeeze(c1)
 
object_key
(expr)
 
trim(c1)
 
table_key
(expr)
 
uppercase(c1)
 
text(expr)
 
 
 
varchar(expr)
 
 
 
vchar(expr)