A labeled duration represents any number of years, months, days, hours, minutes, seconds, or microseconds. This number is then converted as if it were assigned to a DECIMAL(15,0). The unit is expressed by a keyword following the number. For example, 25 YEARS is the labeled duration in HIREDATE + 25 YEARS.
A labeled duration can only be used in an expression that involves a date or time value. For example:
HIREDATE + 25 YEARS + 1 MONTH is valid, but
HIREDATE + (25 YEARS + 1 MONTH) is not valid.
Following is the syntax diagram for labeled durations.
Note: Labeled duration, this is a CA Datacom/DB extension.
►►─┬─ function ──────┬─┬─ DAY ──────────┬─────────────────────────────────────►◄ ├─ (expression) ──┤ ├─ DAYS ─────────┤ ├─ literal ───────┤ ├─ HOUR ─────────┤ ├─ column-name ───┤ ├─ HOURS ────────┤ └─ host-variable ─┘ ├─ MICROSECOND ──┤ ├─ MICROSECONDS ─┤ ├─ MINUTE ───────┤ ├─ MINUTES ──────┤ ├─ MONTH ────────┤ ├─ MONTHS ───────┤ ├─ SECOND ───────┤ ├─ SECONDS ──────┤ ├─ YEAR ─────────┤ └─ YEARS ────────┘
Specify a function. For more information about functions, see Functions.
Specify an expression. For more information about expressions, see Expressions.
Specify a literal. If the expression is numeric, the literal must be numeric. For more information on literals, see Literals.
Specify the name of a column in a table or view. If the expression is an arithmetic expression, the column must be of a numeric data type.
Specify a host-variable. A host-variable in an expression must identify a variable described in the program under the rules for declaring host-variables. For more information on host-variables, see Host Variables.
A duration expressed in day(s). For more information on durations, see Durations.
A duration expressed in hour(s). For more information on durations, see Durations.
A duration expressed in microsecond(s). For more information on durations, see Durations.
A duration expressed in minute(s). For more information on durations, see Durations.
A duration expressed in month(s). For more information on durations, see Durations.
A duration expressed in second(s). For more information on durations, see Durations.
A duration expressed in year(s). For more information on durations, see Durations.
|
Copyright © 2014 CA.
All rights reserved.
|
|