Developer Transformation Guide > Java Transformation API Reference > setNull
  

setNull

Sets the value of an output column to null in an active or passive Java transformation.
Use the following syntax:
setNull(String strColName);
The following table describes the parameter:
Parameter
Parameter Type
Datatype
Description
strColName
Input
String
Name of an output column.
The setNull method sets the value of an output column in an active or passive Java transformation to null. After you set an output column to null, you cannot modify the value until you generate an output row.
You can add the setNull method to the Java code on any code entry tab except the Imports and Functions tabs.
The following Java code shows how to check the value of an input column and set the corresponding value of an output column to null:
// check value of Q3RESULTS input column
if(isNull("Q3RESULTS")) {
     // set the value of output column to null
     setNull("RESULTS");
}
Alternatively, you can use the following Java code achieve the same results:
// check value of Q3RESULTS input column
String strColName = "Q3RESULTS";
if(isNull(strColName)) {
     // set the value of output column to null
     setNull(strColName);
}