## caseExpression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
caseExpression_start((START))
caseExpression_start --> caseExpression_0_0[CASE]
caseExpression_0_0 --> caseExpression_0_1[caseWhenThenExpression]
caseExpression_0_1 --> caseExpression_0_2[caseElseExpression]
caseExpression_0_2 --> caseExpression_0_3[END]
caseExpression_0_3 --> caseExpression_end((END))
```
## Purpose
Evaluates to an expression, testing a number of boolean expressions in sequence for true. When no boolean expression evaluates to true, the else expression is returned.
## caseWhenThenExpression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
caseWhenThenExpression_start((START))
caseWhenThenExpression_start --> caseWhenThenExpression_0_0[WHEN]
caseWhenThenExpression_0_0 --> caseWhenThenExpression_0_1[expression]
caseWhenThenExpression_0_1 --> caseWhenThenExpression_0_2[THEN]:::quoted
caseWhenThenExpression_0_2 --> caseWhenThenExpression_0_3[expression]
caseWhenThenExpression_0_3 --> caseWhenThenExpression_end((END))
```
## caseElseExpression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
caseElseExpression_start((START))
caseElseExpression_start --> caseElseExpression_0_0[ELSE]
caseElseExpression_0_0 --> caseElseExpression_0_1[expression]
caseElseExpression_0_1 --> caseElseExpression_end((END))
```
## castExpression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
castExpression_start((START))
castExpression_start --> castExpression_0_0[CAST]
castExpression_0_0 --> castExpression_0_1["("]
castExpression_0_1 --> castExpression_0_2[expression]
castExpression_0_2 --> castExpression_0_3[AS]
castExpression_0_3 --> castExpression_0_4[sqlDataTypeExtended]
castExpression_0_4 --> castExpression_0_5[")"]
castExpression_0_5 --> castExpression_end((END))
```
## Purpose
Changes the data type of an expression into the indicated data type.
## not
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> not
not -->| | NOT
NOT --> End((END))
```
## is
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> is
is -->| | IS
IS --> End((END))
```
## are
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> are
are -->| | ARE
ARE --> End((END))
```
## and
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> and
and -->| | AND
AND --> End((END))
```
## or
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> or
or -->| | OR
OR --> End((END))
```
## true
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> true
true -->| | TRUE
TRUE --> End((END))
```
## false
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> false
false -->| | FALSE
FALSE --> End((END))
```
## parameterExpression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
parameterExpression_start((START))
parameterExpression_start --> parameterExpression_0_0[COLON]
parameterExpression_0_0 --> parameterExpression_0_1[identifier]
parameterExpression_0_1 --> parameterExpression_end((END))
```
## gt
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> gt
gt -->| | GT
GT --> End((END))
```
## Purpose
Greater then is a binary operator which returns true when the left value is greater than the right value. When one of both values is null, the outcome is null. Otherwise it is false.
## ge
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> ge
ge -->| | GE
GE --> End((END))
```
## Purpose
Greater or equal is a binary operator which returns true when the left value is greater than or equal to the right value. When one of both values is null, the outcome is null. Otherwise it is false.
## lt
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> lt
lt -->| | LT
LT --> End((END))
```
## Purpose
Less then is a binary operator which returns true when the left value is less than the right value. When one of both values is null, the outcome is null. Otherwise it is false.
## le
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> le
le -->| | LE
LE --> End((END))
```
## Purpose
Less or equal is a binary operator which returns true when the left value is less than or equal to the right value. When one of both values is null, the outcome is null. Otherwise it is false.
## eq
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> eq
eq -->| | EQ
EQ --> End((END))
```
## Purpose
Equals is a binary operator which returns true when the left value and right value are identical. When one of both values is null, the outcome is null.
## neq
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> neq
neq -->| | NEQ
NEQ --> End((END))
```
## Purpose
Not equals is a binary operator which returns true when the left value and right value are not identical. When one of both values is null, the outcome is null.
## like
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> like
like -->| | LIKE
LIKE --> End((END))
```
## Purpose
Like is a operator which returns true when the left value matches the right value. Occurrences of '%' in the right value can be matched by a sequence of 0, 1 or more characters in the left value. Occurrences of '' in the right value can be matched by any character in the left value.
## between
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> between
between -->| | BETWEEN
BETWEEN --> End((END))
```
## Purpose
Between is a tertiary operator which returns true when the left value has a value between the second and third values, including edges. When one of values is null, the outcome is null.
## in_
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> in_
in_ -->| | IN
IN --> End((END))
```
## Purpose
In is a n-ary operator which returns true when the left value is one of the right-hand side values after the 'in'.
## expression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
expression_start((START))
expression_start --> expression_0_0[minus]
expression_0_0 --> expression_0_1[plus]
expression_0_1 --> expression_0_2[not]
expression_0_2 --> expression_0_3[expression]
expression_0_3 --> expression_end((END))
expression_start --> expression_1_0[expression]
expression_1_0 --> expression_1_1[concat]
expression_1_1 --> expression_1_2[times]
expression_1_2 --> expression_1_3[divide]
expression_1_3 --> expression_1_4[plus]
expression_1_4 --> expression_1_5[minus]
expression_1_5 --> expression_1_6[gt]
expression_1_6 --> expression_1_7[ge]
expression_1_7 --> expression_1_8[lt]
expression_1_8 --> expression_1_9[le]
expression_1_9 --> expression_1_10[eq]
expression_1_10 --> expression_1_11[neq]
expression_1_11 --> expression_1_12[and]
expression_1_12 --> expression_1_13[or]
expression_1_13 --> expression_1_14[expression]
expression_1_14 --> expression_1_15[not]
expression_1_15 --> expression_1_16[like]
expression_1_16 --> expression_1_17[between]
expression_1_17 --> expression_1_18[expression]
expression_1_18 --> expression_1_19[and]
expression_1_19 --> expression_1_20[expression]
expression_1_20 --> expression_1_21[in_]
expression_1_21 --> expression_1_22["("]
expression_1_22 --> expression_1_23[expression]
expression_1_23 --> expression_1_24[","]:::quoted
expression_1_24 --> expression_1_25[expression]
expression_1_25 --> expression_1_26[selectStatement]
expression_1_26 --> expression_1_27[")"]
expression_1_27 --> expression_1_28[is]
expression_1_28 --> expression_1_29[not]
expression_1_29 --> expression_1_30[NULL]
expression_1_30 --> expression_end((END))
expression_start --> expression_2_0[not]
expression_2_0 --> expression_2_1[exists]
expression_2_1 --> expression_2_2["("]
expression_2_2 --> expression_2_3[selectStatement]
expression_2_3 --> expression_2_4["("]
expression_2_4 --> expression_2_5[selectStatement]
expression_2_5 --> expression_2_6[expression]
expression_2_6 --> expression_2_7[")"]
expression_2_7 --> expression_end((END))
expression_start --> expression_3_0[constantExpression]
expression_3_0 --> expression_end((END))
expression_start --> expression_4_0[functionExpression]
expression_4_0 --> expression_end((END))
expression_start --> expression_5_0[parameterExpression]
expression_5_0 --> expression_end((END))
expression_start --> expression_6_0[triggerRecordVariableExpression]
expression_6_0 --> expression_end((END))
expression_start --> expression_7_0[castExpression]
expression_7_0 --> expression_end((END))
expression_start --> expression_8_0[caseExpression]
expression_8_0 --> expression_end((END))
expression_start --> expression_9_0[arrayExpression]
expression_9_0 --> expression_end((END))
expression_start --> expression_10_0[pSqlCallProcedureStatementNS]
expression_10_0 --> expression_end((END))
expression_start --> expression_11_0[fieldIdentifier]
expression_11_0 --> expression_end((END))
expression_start --> expression_12_0[bindVariable]
expression_12_0 --> expression_end((END))
```
## bindVariable
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> bindVariable
bindVariable -->| | BIND_VARIABLE
BIND_VARIABLE --> End((END))
```
## arrayExpression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
arrayExpression_start((START))
arrayExpression_start --> arrayExpression_0_0[ARRAY_OPEN]
arrayExpression_0_0 --> arrayExpression_0_1[expression]
arrayExpression_0_1 --> arrayExpression_0_2[","]:::quoted
arrayExpression_0_2 --> arrayExpression_0_3[expression]
arrayExpression_0_3 --> arrayExpression_0_4[ARRAY_CLOSE]
arrayExpression_0_4 --> arrayExpression_end((END))
```
## functionExpression
A `functionExpression` is one of the following SQL functions:
```dataview
LIST
WHERE file.folder = "Invantive UniversalSQL/Grammar/SQL Functions"
AND file.name != this.file.name
SORT file.name ASC
```
## divide
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> divide
divide -->| | DIVIDE
DIVIDE --> End((END))
```
## Purpose
Divide one number by the second number.
Parameters:
- first: a number to divide.
- second: a number to divide with.
Returns: the divided output.
## exists
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> exists
exists -->| | EXISTS
EXISTS --> End((END))
```
## ln
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> ln
ln -->| | LN
LN --> End((END))
```
## Purpose
The `LN` function gets the natural logarithm of a number.
Parameters:
- Input: a number to get the natural logarithm from.
Returns: the natural logarithm of the input.
## minus
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> minus
minus -->| | MINUS
MINUS --> End((END))
```
## Purpose
The `MINUS` functions subtracts a value from another.
Parameters:
- Value: a number or datetime.
- Subtract: a number or datetime.
Returns: the value minus the subtraction.
## plus
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> plus
plus -->| | PLUS
PLUS --> End((END))
```
## Purpose
The `PLUS` function adds a value to another.
Parameters:
- Value: a number or datetime.
- add: a number or datetime.
Returns: A new value with both values added to eachother.
## times
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> times
times -->| | ASTERIX
ASTERIX --> End((END))
```
## Purpose
The `TIMES` function multiplies one number by the second number.
Parameters:
- First: a number to multiply.
- Second: a number to multiply with.
Returns: the first number multiplied by the second number.
## constantExpression
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> constantExpression
constantExpression -->| | stringConstant
stringConstant --> End((END))
constantExpression -->| | numericConstant
numericConstant --> End((END))
constantExpression -->| | booleanConstant
booleanConstant --> End((END))
constantExpression -->| | intervalConstant
intervalConstant --> End((END))
constantExpression -->| | null
null --> End((END))
```
## stringConstant
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
stringConstant_start((START))
stringConstant_start --> stringConstant_0_0[stringOrChar]
stringConstant_0_0 --> stringConstant_0_1[CONCAT_OP]
stringConstant_0_1 --> stringConstant_0_2[stringOrChar]
stringConstant_0_2 --> stringConstant_end((END))
```
## Purpose
A constant text value with varchar2 data type.
## stringOrChar
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> STRING_C
STRING_C --> parenthesisOpen
parenthesisOpen --> INT_OR_DECIMAL_C
INT_OR_DECIMAL_C --> parenthesisClose
parenthesisClose --> STRING_C
STRING_C --> End((END))
```
## intervalConstant
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
intervalConstant_start((START))
intervalConstant_start --> intervalConstant_0_0[INTERVAL]
intervalConstant_0_0 --> intervalConstant_0_1[stringConstant]
intervalConstant_0_1 --> intervalConstant_end((END))
```
## Purpose
A constant interval value, reflecting the time span between two dates. The string constant consists of an integer number and unit of time, taken from the following list:
- Millisecond,
- second,
- minute,
- hour,
- day,
- week, and
- year.
The units may be postfixed with an 's' without changing meaning, like 'years'.
Valid interval values are for example: "5 seconds", "20 hours" and "1 year". There is no support for combined intervals such as "30 minutes and 30 seconds".
## numericConstant
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> numericConstant
numericConstant -->| | INT_OR_DECIMAL_C
INT_OR_DECIMAL_C --> End((END))
numericConstant -->| | E_NOTATION_C
E_NOTATION_C --> End((END))
```
## Purpose
A constant numeric value with numeric data type.
## booleanConstant
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> booleanConstant
booleanConstant -->| | true
true --> End((END))
booleanConstant -->| | false
false --> End((END))
```