This function is used to replace the value NULL with another value. If data1 is null, it will return data2 and if data1 is not null it will return data1.
It should be considered that the arguments (data1 and data2) can contain any type of data, but in case of be of a different type, the database will automatically
convert them and in the case of can not convert them, the system will return an error.
1 sql.nvl
<sql.nvl>
<data1 /> !
<data2 /> !
</sql.nvl>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Edata1 | string | Data received as first argument. | |||
Edata2 | string | Data received as second argument. |
Returns | |
---|---|
Type | Description |
Será el mismo de los argumentos que recibe | Returns the value of data1 or data2 in function if data1 is null or not. |
Example
Copy
<xsql-script name='test_sql_nvl'> <body> <set name='data1'><null/></set> <set name='data2'>DATA2</set> <println> <sql.nvl> <data1/> <data2/> </sql.nvl> </println> </body> </xsql-script>