Altova MapForce 2025 Professional Edition

Returns the field itself if it is not null; otherwise, replace-with is returned.

mf-func-substitute-null

 

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\MapForce2025\MapForceExamples\ folder.

mf-func-substitute-null-example

The mapping reads data from an SQLite database which contains an "Applications" table.

mf-func-substitute-null-example1

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.

© 2018-2024 Altova GmbH