SetNull Method for LCField

This method sets the value of the field to the special value NULL. This value is recognized by relational databases as representing an empty field (as opposed to a field that contains a zero-length string, for instance).

Defined In

LCField

Syntax

Call thisField.SetNull (index, boolValue)

Parameters

Parameter

Description

index

Long. Index identifying the field.

boolValue

(optional) Boolean, default True. Use True to set the field to null, False to set to non-null.

Usage

There's no reason to ever use a boolValue argument of False. Instead, assign the field with the value you want it to have; that will also clear the "null flag."

Using the LotusScript® predefined constant Null instead (for example: thisField.Value = Null ) will give the error "Unsupported argument type to external function."

Example

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim fldLunaticNum As LCField
  ...
  lcconFrom.Select(flKeys, 0, flLunaticRecord)
  Set fldLunaticNum = flLunaticRecord.Lookup("LUNATICID")
  Do While lcconFrom.Fetch(flLunaticRecord)
	Call fldLunaticNum.SetNull(1)
	Call lcconTo.Insert(flLunaticRecord)
  Loop
End Sub

Example Output

The records are copied over from connection lcconFrom to connection lcconTo, but the output records contain a NULL value in the LUNATICID field.

See also

IsNull property of LCField