4gl expression is a sequence of operands, operators, and parentheses treated by 4gl as a single value.
The notion of a 4gl expression is closely related to the notion of a 4gl data type. Data types characterize general categories of values. Expressions define specific data values.
4gl expressions can be used as arguments in
Data type returned by a 4gl expression depends on the syntax of this expression and the context in which it is used. Depending on the data type of the returned value, 4gl expressions can be divided into 3 major categories:
Numeric expressions return values of any numeric data type.
Includes
Number expressions that return values of any of the number data types:
with a fixed point – DECIMAL(p,s) / DEC(p,s) / NUMERIC(p,s), MONEY(p,s)
with a floating point – DECIMAL(p) / DEC(p) / NUMERIC(p), FLOAT / DOUBLE PRECISION, SMALLFLOAT / REAL
Character expressions return a character string of CHAR, NCHAR, VARCHAR, NVARCHAR, LVARVHAR, or STRING, data type
Time Expressions return a value that belongs to INTERVAL, DATE, or DATETIME data type
In this online documentation, we use the term 4GL expression to refer any of these expression types or all of them together.