substitute-null
Returns the field itself if it is not null; otherwise, replace-with is returned.
Languages
Built-in, C++, C#, Java.
Parameters
Name | Description |
---|---|
field | The database field. |
replace-with | The replacement value. |
Example
The mapping below shows an example of the substitute-null function in use. This mapping is called DB-ApplicationList.mfd and is available in the <Documents>\Altova\MapForce2024\MapForceExamples\ folder.
The mapping reads data from an SQLite database which contains an "Applications" table.
The first function checks if the Category field is null in the "Applications" table. Since this field is null for the Notepad application, the substitute value "Misc" is mapped to the Category item of the target text file.
The second function checks if the Description field is null. Again, this field is null for the Notepad application, so the substitute value "No description" is mapped to the Description item of the target file.