1 decode
It changes the value of an expression if it is equal to one of the searched values.
<decode
when='when'
cond='cond'
then='then'
else='else'
/>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Awhen | string | Value to which the condition applies. | |||
Acond | string | Condition value. | |||
Athen | string | Value that applies if the condition is true. | |||
Aelse | string | Value that applies if the condition is not true. |
Example
Copy
<select> <columns> <decode when='deptno' cond='10' then='ACCOUNTING' else='NONE'/> </columns> <from table='test'/> </select>
2 nvl
This tag is used to convert an expression that evaluates as NULL to the value specified.
<nvl>
<expresion /> *
</nvl>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eexpresion | string | The value or expression to be evaluate and the value to return separated by comma. |
Example
If 'salario' is null, the value 0 must be returned.
Copy
<select> <columns> <nvl>salario,0</nvl> </columns> <from table='empleados'/> </select>