ModSQL
Class Function_NVL
java.lang.Object
|
+--ModSQL.AbstractFunction
|
+--ModSQL.Function_NVL
- All Implemented Interfaces:
- Function
- final class Function_NVL
- extends AbstractFunction
SQL function for NVL (null value substitution function).
- Author:
- chris.studholme@utoronto.ca
|
Field Summary |
private int |
return_type
Return type of function. |
|
Method Summary |
Object |
evaluate(boolean aggregate)
Evaluate parameters and compute the function. |
static Function |
forName(String name)
If name is "nvl", this method returns an instance of this class. |
String |
functionName()
Returns "#NVL". |
int |
getMaxResultSize()
Make size of any String that may be returned, or -1 if a maximum size
is not known. |
int |
getSQLType()
Returns the SQL type of this function. |
void |
optimize()
Prepare the function for use. |
| Methods inherited from class ModSQL.AbstractFunction |
addParameter, convertToSQLType, evaluate, evaluateConstantParameters, evaluateOrder, evaluateParameters, evaluateParameters, getCompatableType, getObjectSQLType, getParameter, getParameterCount, isAggregate, isConstant, postfixParameters, prefixParameters, registerWith, reset, toString |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
return_type
private int return_type
- Return type of function.
Function_NVL
Function_NVL()
forName
public static Function forName(String name)
- If name is "nvl", this method returns an instance of this class.
- Parameters:
name - name of desired function- Returns:
- instance of this class, or null if name does not match
optimize
public void optimize()
throws SQLException
Prepare the function for use.
- Overrides:
optimize in class AbstractFunction
- Throws:
SQLException - if the parameters are invalid
getSQLType
public int getSQLType()
- Returns the SQL type of this function.
- Returns:
- SQL type of data to be returned
getMaxResultSize
public int getMaxResultSize()
throws SQLException
- Make size of any String that may be returned, or -1 if a maximum size
is not known.
- Returns:
- maximum size of String returned or -1 if unknown
- Throws:
SQLException - if thrown by a parameter
functionName
public String functionName()
- Returns "#NVL".
- Overrides:
functionName in class AbstractFunction
- Returns:
- name of function
evaluate
public Object evaluate(boolean aggregate)
throws SQLException,
EndOfTable
Evaluate parameters and compute the function.
- Parameters:
aggregate - passed to parameter- Returns:
- result object
- Throws:
SQLException - if a database-access error occursEndOfTable - if thrown by a parameter