uCosminexus Stream Data Platform - Application Framework Application Development Guide
value-expression::=[sign]term[operator[sign]term]...
term::=[cast-specification]value-expression-primary
operator::={+|-|*|/}
sign::={+|-}
cast-specification::={'('TINYINT')'|'('SMALLINT')'|'('INT[EGER]')'
|'('BIGINT')'|'('REAL')'|'('FLOAT')'|'('DOUBLE')'
|'('DEC[IMAL]')'}
value-expression-primary::={column-specification|column-name|constant|'('value-expression')'}
Specifies a value.
Specify + or -.
Specify a value expression primary and, optionally, a cast specification.
For details about the data types that can be specified for cast specification, see 3.3 CQL data types.
Specify a column specification, a column name, a constant, or a value expression.
Specify +, -, *, or /. When specifying a singed term after an operator, enclose the term in parentheses. Signs and operator examples follow:
-a+(-b) a*(-b+1) a/(-b)+1
Table 4-8 Relationship between the data types used in the four arithmetic operations (binomial operations) and the resulting data type
| No. | Data type of first operand | Data type of second operand | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| TNY | SML | INT | BIG | RL | FLT | DBL | DEC | NUM | ||
| 1 | TNY | TNY | SML | INT | BIG | RL | FLT | DBL | DEC | NUM |
| 2 | SML | SML | SML | INT | BIG | RL | FLT | DBL | DEC | NUM |
| 3 | INT | INT | INT | INT | BIG | RL | FLT | DBL | DEC | NUM |
| 4 | BIG | BIG | BIG | BIG | BIG | RL | FLT | DBL | DEC | NUM |
| 5 | RL | RL | RL | RL | RL | RL | FLT | DBL | DEC | NUM |
| 6 | FLT | FLT | FLT | FLT | FLT | FLT | FLT | FLT | DEC | NUM |
| 7 | DBL | DBL | DBL | DBL | DBL | DBL | DBL | DBL | DEC | NUM |
| 8 | DEC | DEC | DEC | DEC | DEC | DEC | DEC | DEC | DEC | DEC |
| 9 | NUM | NUM | NUM | NUM | NUM | NUM | NUM | NUM | NUM | NUM |
Outputs the values obtained by casting column a in relation s1 into DECIMAL data and column b into INT data. The underlined parts indicate value expressions.
REGISTER QUERY q1 SELECT (DECIMAL)s1.a AS xxx, (INT)s1.b AS yyy FROM s1[ROWS 100];
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.