
public class OSQLFunctionIfNull extends OSQLFunctionAbstract
field/value (or optional parameter return_value_if_not_null) if
field/value is not null; otherwise it returns return_value_if_null.
Syntax:
ifnull(<field|value>, <return_value_if_null> [,<return_value_if_not_null>])
Examples:
SELECT ifnull('a', 'b') FROM ...
-> 'a'
SELECT ifnull('a', 'b', 'c') FROM ...
-> 'c'
SELECT ifnull(null, 'b') FROM ...
-> 'b'
SELECT ifnull(null, 'b', 'c') FROM ...
-> 'b'
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
maxParams, minParams, name| Constructor and Description |
|---|
OSQLFunctionIfNull() |
| Modifier and Type | Method and Description |
|---|---|
Object |
execute(Object iThis,
OIdentifiable iCurrentRecord,
Object iCurrentResult,
Object[] iParams,
OCommandContext iContext)
Process a record.
|
String |
getSyntax()
Returns a convinient SQL String representation of the function.
|
aggregateResults, config, filterResult, getDistributedStorageId, getMaxParams, getMinParams, getName, getResult, mergeDistributedResult, returnDistributedResult, setResult, shouldMergeDistributedResult, toStringpublic static final String NAME
public Object execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult, Object[] iParams, OCommandContext iContext)
OSQLFunctioniCurrentRecord - : current recordiCurrentResult - TODOiParams - : function parameters, number is ensured to be within minParams and maxParams.iContext - : object calling this functionpublic String getSyntax()
OSQLFunctionExample :
myFunction( param1, param2, [optionalParam3])This text will be used in exception messages.
Copyright © 2009–2025 OrientDB. All rights reserved.