Caigen Access Scalar Functions and Aggregate Functions
Index:
type Value | Expected expr Format |
MICROSECOND[S] | MICROSECONDS |
MILLISECOND[S] | MILLISECONDS |
SECOND | SECONDS |
MINUTE | MINUTES |
HOUR | HOURS |
DAY | DAYS |
WEEK | WEEKS |
MONTH | MONTHS |
QUARTER | QUARTERS |
YEAR | YEARS |
DECADE | DECADES |
CENTURY | CENTURYS |
MILLENNIUM | MILLENNIUMS |
SECOND_MICROSECOND | 'SECONDS.MICROSECONDS' |
MINUTE_MICROSECOND | 'MINUTES.MICROSECONDS' |
MINUTE_SECOND | 'MINUTES:SECONDS' |
HOUR_MICROSECOND | 'HOURS.MICROSECONDS' |
HOUR_SECOND | 'HOURS:MINUTES:SECONDS' |
HOUR_MINUTE | 'HOURS:MINUTES' |
DAY_MICROSECOND | 'DAYS.MICROSECONDS' |
DAY_SECOND | 'DAYS HOURS:MINUTES:SECONDS' |
DAY_MINUTE | 'DAYS HOURS:MINUTES' |
DAY_HOUR | 'DAYS HOURS' |
YEAR_MONTH | 'YEARS-MONTHS' |
INTERVAL Value | Expected expr Format |
yyyy | Year |
q | Quarter |
m | Month |
y | Day of the year |
d | Day |
w | Weekday |
ww | Week |
h | Hour |
n | Minute |
s | Second |
type Value | Expected Result |
MICROSECOND[S] | MILLISECOND*1000 |
MILLISECOND[S] | indicats the millisecond within the second. |
SECOND | indicats the second within the minute |
MINUTE | MINUTES |
HOUR | HOURS |
DAY | DAYS |
MONTH | MONTHS |
QUARTER | QUARTERS |
YEAR | YEARS |
DECADE | DECADES |
CENTURY | CENTURYS |
MILLENNIUM | MILLENNIUMS |
DOW | indicates the day of the week, SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY(1~7). |
DOY | indicates the day number within the year. The first day of the year has value 1. |
WEEK,WOM | indicats the ordinal number of the day of the week within the current month. |
WOY | indicats the ordinal number of the day of the week within the current year. |
EPOCH | the current time as UTC milliseconds from the epoch(1970-01-01 00:00:00). |
Function Argument Type Return Type DescriptionDECODE( expression , search , result [, search , result]... [, default] )
expression is the value to compare. search is the value that is compared against expression. result is the value returned, if expression is equal to search. default is optional. If no matches are found, the decode will return default. If default is omitted, then the decode statement will return null (if no matches are found). same as argument type The decode function has the functionality of an IF-THEN-ELSE statement. GREATEST(expression1,expression2[,...])
MAX(expression1,expression2[,...])
any numeric, string, date/time, or boolean type same as argument type maximum value of all expressions LEAST(expression1,expression2[,...])
MIN(expression1,expression2[,...])
any numeric, string, date/time, or boolean type same as argument type minimum value of all expressions IF(lExpression, eExpression1, eExpression2)
IIF(lExpression, eExpression1, eExpression2)
lExpression specifies the logical expression that IF()/IIF( ) evaluates.
Returns one of two values depending on the value of a logical expression.
If lExpression evaluates to true , eExpression1 is returned. If lExpression evaluates to false, eExpression2 is returned. NVL(expression, value)
IFNULL(expression, value)
any numeric, string, date/time, or boolean type Returns one of two values depending on whether expression is null. If expression evaluates to null , value is returned. Otherwise, expression is returned. INLIST(eExpression1, eExpression2 [, eExpression3 ...]) eExpression1 specifies the expression INLIST( ) searches for in the set of expressions. eExpression2 [, eExpression3 ...] specifies the set of expressions to search. You must include at least one expression (eExpression2), and can include up to 24 expressions (eExpression2, eExpression3, and so on). Determines whether an expression matches another expression in a set of expressions. All the expressions in the set of expressions must be of the same data type.
COALESCE(value [, ...]) any numeric, string, date/time, or boolean type the type of the first of its arguments that is not null returns the first of its arguments that is not null ELT(numberExpression,value1Expression,[value2Expression,...]) numberExpression must be a integer type,value expression can be any type Returns value depending on the numberExpression,value1Expression,...valuexExpression Returns value1Expression if numberExpression = 1, value2Expression if numberExpression = 2, and so on. Returns NULL if N is less than 1 or greater than the number of arguments. INTERVAL(expression,expr1,expr2,...,exprn) any numeric, string, date/time, or boolean type integer value returns 0 if expression< expr1, 1 if expression< expr2 and so on or -1 if expressionN is NULL. If expression>exprn, returns n. TRANSFER (expression, search_1, result_1)
TRANSFER (expression, search_1, result_1, search_2, result_2)
TRANSFER (expression, search_1, result_1, search_2, result_2, ...., search_n, result_n)
TRANSFER (expression, search_1, result_1, default)
TRANSFER (expression, search_1, result_1, search_2, result_2, default)
TRANSFER (expression, search_1, result_1, search_2, result_2, ...., search_n, result_n, default)any numeric, string, date/time, or boolean type,or null Returns value depending on the expression,search_x,result_x and default TRANSFER compares expression to the search_x expressions and, if matches, returns result_x. If not, returns default, or, if default is left out, return null . TRANSFORM(expression [, formatcodes]) expression specifies the character, currency, date, or numeric expression to format.
formatcode specifies one format code that determine how the expression is formatted. The following table lists the available format codes
Format Code Description @C CR is appended to positive currency or numeric values to indicate a credit. @D act as DTOS function. @E act as DTOS function. @T leading and trailing spaces are trimmed from character values. @X db is appended to negative currency or numeric values to indicate a debit. @Z if 0, currency or numeric values are converted to spaces. @( encloses negative currency or numeric values in parentheses. @^ converts currency or numeric values to scientific notation. @0 converts numeric or currency values to their hexadecimal equivalents. The numeric or currency value must be positive and less than 4,294,967,296. ! converts a character to uppercase. $ adds the current currency symbol specified by SET CURRENCY to currency and numeric values. By default, the symbol is placed immediately before or after the value. However, the currency symbol and its placement (specified with SET CURRENCY), the separator character (specified with SET SEPARATOR) and the decimal character (specified with SET POINT) can all be changed. X specifies the width of character values. For example, if cFormatCodes is XX? 2 characters are returned. Y converts logical true (.T.) and false (.F.) values to Y and N, respectively. @! converts a string to uppercase. return the formatted string returns a character string from an expression in a format determined by a format code