Skip to main content

default (Function)

Checks if the attribute parameter is null and if so returns the value of the default parameter

Syntax

    <INT|LONG|DOUBLE|FLOAT|STRING|BOOL|OBJECT> default(<INT|LONG|DOUBLE|FLOAT|STRING|BOOL|OBJECT> attribute, <INT|LONG|DOUBLE|FLOAT|STRING|BOOL|OBJECT> default)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
attributeThe attribute that could be null.INT LONG DOUBLE FLOAT STRING BOOL OBJECTNoYes
defaultThe default value that will be used when attribute parameter is nullINT LONG DOUBLE FLOAT STRING BOOL OBJECTNoYes

Example 1

    insert into StandardTempStream
select default(temp, 0.0) as temp, roomNum
from TempStream;

This replaces TempStream's temp attribute with default value if the temp is null.