Top Description Fields Constructors Methods
org.hsqldb

public Class FunctionCustom

extends FunctionSQL
Class Inheritance
Imports
java.math.BigDecimal, java.time.format.DateTimeFormatter, java.util.Calendar, .Locale, .UUID, java.util.regex.Matcher, .Pattern, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.ArrayUtil, .HsqlArrayList, .IntKeyIntValueHashMap, .IntValueHashMap, .StringConverter, .StringUtil, org.hsqldb.lib.java.JavaSystem, org.hsqldb.map.BitMap, .ValuePool, org.hsqldb.persist.Crypto, .HsqlDatabaseProperties, org.hsqldb.types.ArrayType, .BinaryData, .BinaryType, .BlobData, .CharacterType, .ClobData, .DTIType, .DateFormat, .DateTimeType, .HsqlDateTime, .IntervalMonthData, .IntervalSecondData, .IntervalType, .LobData, .NumberFormat, .NumberType, .TimeData, .TimestampData, .Type, .Types

Implementation of HSQLDB functions that are not defined by the SQL standard.

Some functions are translated into equivalent SQL Standard functions.

Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.7.3

Field Summary

Modifier and TypeField and Description
private IntKeyIntValueHashMap
pack-priv static final IntKeyIntValueHashMap
pack-priv static final IntKeyIntValueHashMap
private DateTimeFormatter
private int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private Pattern
private static IntValueHashMap<K>
private static IntKeyIntValueHashMap
private static IntValueHashMap<K>
Inherited from org.hsqldb.FunctionSQL:
doubleParamListemptyParamListFUNC_BIT_LENGTHFUNC_CHAR_LENGTHFUNC_CURRENT_DATEFUNC_CURRENT_TIMEFUNC_CURRENT_TIMESTAMPFUNC_EXTRACTFUNC_FOLD_LOWERFUNC_FOLD_UPPERFUNC_LNFUNC_LOCALTIMEFUNC_LOCALTIMESTAMPFUNC_OCTET_LENGTHFUNC_OVERLAY_CHARFUNC_POSITION_CHARFUNC_SUBSTRING_CHARFUNC_TRIM_CHARFUNC_USERfuncTypeisDeterministicisSQLValueFunctionnamenonDeterministicFuncSetnoParamListoptionalDoubleParamListoptionalIntegerParamListoptionalNoParamListoptionalSingleParamListparseListparseListAltquadParamListregularFuncMapsingleParamListtripleParamListvalueFuncMap

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static int
public Expression
public String
getSQL()

Overrides org.hsqldb.FunctionSQL.getSQL.

For use with CHECK constraints.

private String
pack-priv static int
private static IntKeyIntValueHashMap
private static int
pack-priv Object
public static boolean
isRegularFunction(int tokenType)

public static boolean
isValueFunction(int tokenType)

public static FunctionSQL
newCustomFunction(Session session, String token, int tokenType)

private static int
public void
public void
private static char[]

Returns:

the 4 character SOUNDEX value for the given String
soundex
(String
the String for which to calculate the 4 character SOUNDEX value
s
)

Returns a four character code representing the sound of the given String.

private static String
Inherited from org.hsqldb.FunctionSQL:
describeequalsgetExtractValuegetValuehashCodeisDeterministicisValueFunctionnewSQLFunction

Field Detail

charLookupback to summary
private IntKeyIntValueHashMap charLookup
customRegularFuncMapback to summary
pack-priv static final IntKeyIntValueHashMap customRegularFuncMap
customValueFuncMapback to summary
pack-priv static final IntKeyIntValueHashMap customValueFuncMap
dateTimeFormatterback to summary
private DateTimeFormatter dateTimeFormatter
extractSpecback to summary
private int extractSpec
FUNC_ACOSback to summary
private static final int FUNC_ACOS
FUNC_ACTION_IDback to summary
private static final int FUNC_ACTION_ID
FUNC_ADD_MONTHSback to summary
private static final int FUNC_ADD_MONTHS
FUNC_ASCIIback to summary
private static final int FUNC_ASCII
FUNC_ASCIISTRback to summary
private static final int FUNC_ASCIISTR
FUNC_ASINback to summary
private static final int FUNC_ASIN
FUNC_ATANback to summary
private static final int FUNC_ATAN
FUNC_ATAN2back to summary
private static final int FUNC_ATAN2
FUNC_BITANDback to summary
private static final int FUNC_BITAND
FUNC_BITANDNOTback to summary
private static final int FUNC_BITANDNOT
FUNC_BITNOTback to summary
private static final int FUNC_BITNOT
FUNC_BITORback to summary
private static final int FUNC_BITOR
FUNC_BITXORback to summary
private static final int FUNC_BITXOR
FUNC_CHARback to summary
private static final int FUNC_CHAR
FUNC_CONCATback to summary
private static final int FUNC_CONCAT
FUNC_COSback to summary
private static final int FUNC_COS
FUNC_COSHback to summary
private static final int FUNC_COSH
FUNC_COTback to summary
private static final int FUNC_COT
FUNC_CRYPT_KEYback to summary
private static final int FUNC_CRYPT_KEY
FUNC_CURRENT_TIMEZONEback to summary
private static final int FUNC_CURRENT_TIMEZONE
FUNC_DATABASEback to summary
private static final int FUNC_DATABASE
FUNC_DATABASE_ISOLATION_LEVELback to summary
private static final int FUNC_DATABASE_ISOLATION_LEVEL
FUNC_DATABASE_NAMEback to summary
private static final int FUNC_DATABASE_NAME
FUNC_DATABASE_TIMEZONEback to summary
private static final int FUNC_DATABASE_TIMEZONE
FUNC_DATABASE_VERSIONback to summary
private static final int FUNC_DATABASE_VERSION
FUNC_DATE_ADDback to summary
private static final int FUNC_DATE_ADD
FUNC_DATE_SUBback to summary
private static final int FUNC_DATE_SUB
FUNC_DATEADDback to summary
private static final int FUNC_DATEADD
FUNC_DATEDIFFback to summary
private static final int FUNC_DATEDIFF
FUNC_DATENAMEback to summary
private static final int FUNC_DATENAME
FUNC_DATEPARTback to summary
private static final int FUNC_DATEPART
FUNC_DAYSback to summary
private static final int FUNC_DAYS
FUNC_DBTIMEZONEback to summary
private static final int FUNC_DBTIMEZONE
FUNC_DEGREESback to summary
private static final int FUNC_DEGREES
FUNC_DIAGNOSTICSback to summary
private static final int FUNC_DIAGNOSTICS
FUNC_DIFFERENCEback to summary
private static final int FUNC_DIFFERENCE
FUNC_FROM_BASE64back to summary
private static final int FUNC_FROM_BASE64
FUNC_FROM_TZback to summary
private static final int FUNC_FROM_TZ
FUNC_HEXback to summary
private static final int FUNC_HEX
FUNC_HEXTORAWback to summary
private static final int FUNC_HEXTORAW
FUNC_IDENTITYback to summary
private static final int FUNC_IDENTITY
FUNC_INSTRback to summary
private static final int FUNC_INSTR
FUNC_ISAUTOCOMMITback to summary
private static final int FUNC_ISAUTOCOMMIT
FUNC_ISOLATION_LEVELback to summary
private static final int FUNC_ISOLATION_LEVEL
FUNC_ISREADONLYDATABASEback to summary
private static final int FUNC_ISREADONLYDATABASE
FUNC_ISREADONLYDATABASEFILESback to summary
private static final int FUNC_ISREADONLYDATABASEFILES
FUNC_ISREADONLYSESSIONback to summary
private static final int FUNC_ISREADONLYSESSION
FUNC_LAST_DAYback to summary
private static final int FUNC_LAST_DAY
FUNC_LEFTback to summary
private static final int FUNC_LEFT
FUNC_LOAD_FILEback to summary
private static final int FUNC_LOAD_FILE
FUNC_LOB_IDback to summary
private static final int FUNC_LOB_ID
FUNC_LOCATEback to summary
private static final int FUNC_LOCATE
FUNC_LOG10back to summary
private static final int FUNC_LOG10
FUNC_LPADback to summary
private static final int FUNC_LPAD
FUNC_LTRIMback to summary
private static final int FUNC_LTRIM
FUNC_MONTHS_BETWEENback to summary
private static final int FUNC_MONTHS_BETWEEN
FUNC_NANVLback to summary
private static final int FUNC_NANVL
FUNC_NEW_TIMEback to summary
private static final int FUNC_NEW_TIME
FUNC_NEXT_DAYback to summary
private static final int FUNC_NEXT_DAY
FUNC_NUMTODSINTERVALback to summary
private static final int FUNC_NUMTODSINTERVAL
FUNC_NUMTOYMINTERVALback to summary
private static final int FUNC_NUMTOYMINTERVAL
FUNC_PIback to summary
private static final int FUNC_PI
FUNC_POSITION_ARRAYback to summary
private static final int FUNC_POSITION_ARRAY
FUNC_RADIANSback to summary
private static final int FUNC_RADIANS
FUNC_RANDback to summary
private static final int FUNC_RAND
FUNC_RAWTOHEXback to summary
private static final int FUNC_RAWTOHEX
FUNC_REGEXP_COUNTback to summary
private static final int FUNC_REGEXP_COUNT
FUNC_REGEXP_INSTRback to summary
private static final int FUNC_REGEXP_INSTR
FUNC_REGEXP_LIKEback to summary
private static final int FUNC_REGEXP_LIKE
FUNC_REGEXP_MATCHESback to summary
private static final int FUNC_REGEXP_MATCHES
FUNC_REGEXP_REPLACEback to summary
private static final int FUNC_REGEXP_REPLACE
FUNC_REGEXP_SUBSTRback to summary
private static final int FUNC_REGEXP_SUBSTR
FUNC_REGEXP_SUBSTRINGback to summary
private static final int FUNC_REGEXP_SUBSTRING
FUNC_REGEXP_SUBSTRING_ARRAYback to summary
private static final int FUNC_REGEXP_SUBSTRING_ARRAY
FUNC_REPEATback to summary
private static final int FUNC_REPEAT
FUNC_REPLACEback to summary
private static final int FUNC_REPLACE
FUNC_REVERSEback to summary
private static final int FUNC_REVERSE
FUNC_RIGHTback to summary
private static final int FUNC_RIGHT
FUNC_ROUNDback to summary
private static final int FUNC_ROUND
FUNC_ROUNDMAGICback to summary
private static final int FUNC_ROUNDMAGIC
FUNC_RPADback to summary
private static final int FUNC_RPAD
FUNC_RTRIMback to summary
private static final int FUNC_RTRIM
FUNC_SECONDS_MIDNIGHTback to summary
private static final int FUNC_SECONDS_MIDNIGHT
FUNC_SEQUENCE_ARRAYback to summary
private static final int FUNC_SEQUENCE_ARRAY
FUNC_SESSION_IDback to summary
private static final int FUNC_SESSION_ID
FUNC_SESSION_ISOLATION_LEVELback to summary
private static final int FUNC_SESSION_ISOLATION_LEVEL
FUNC_SESSION_TIMEZONEback to summary
private static final int FUNC_SESSION_TIMEZONE
FUNC_SESSIONTIMEZONEback to summary
private static final int FUNC_SESSIONTIMEZONE
FUNC_SIGNback to summary
private static final int FUNC_SIGN
FUNC_SINback to summary
private static final int FUNC_SIN
FUNC_SINHback to summary
private static final int FUNC_SINH
FUNC_SORT_ARRAYback to summary
private static final int FUNC_SORT_ARRAY
FUNC_SOUNDEXback to summary
private static final int FUNC_SOUNDEX
FUNC_SPACEback to summary
private static final int FUNC_SPACE
FUNC_SQLCODEback to summary
private static final int FUNC_SQLCODE
FUNC_SQLERRMback to summary
private static final int FUNC_SQLERRM
FUNC_SUBSTRback to summary
private static final int FUNC_SUBSTR
FUNC_SYS_EXTRACT_UTCback to summary
private static final int FUNC_SYS_EXTRACT_UTC
FUNC_SYS_GUIDback to summary
private static final int FUNC_SYS_GUID
FUNC_SYSDATEback to summary
private static final int FUNC_SYSDATE
FUNC_SYSTIMESTAMPback to summary
private static final int FUNC_SYSTIMESTAMP
FUNC_TANback to summary
private static final int FUNC_TAN
FUNC_TANHback to summary
private static final int FUNC_TANH
FUNC_TIMESTAMPback to summary
private static final int FUNC_TIMESTAMP
FUNC_TIMESTAMP_WITH_ZONEback to summary
private static final int FUNC_TIMESTAMP_WITH_ZONE
FUNC_TIMESTAMPADDback to summary
private static final int FUNC_TIMESTAMPADD
FUNC_TIMESTAMPDIFFback to summary
private static final int FUNC_TIMESTAMPDIFF
FUNC_TIMEZONEback to summary
private static final int FUNC_TIMEZONE
FUNC_TO_BASE64back to summary
private static final int FUNC_TO_BASE64
FUNC_TO_CHARback to summary
private static final int FUNC_TO_CHAR
FUNC_TO_DATEback to summary
private static final int FUNC_TO_DATE
FUNC_TO_DSINTERVALback to summary
private static final int FUNC_TO_DSINTERVAL
FUNC_TO_NUMBERback to summary
private static final int FUNC_TO_NUMBER
FUNC_TO_TIMESTAMPback to summary
private static final int FUNC_TO_TIMESTAMP
FUNC_TO_TIMESTAMP_TZback to summary
private static final int FUNC_TO_TIMESTAMP_TZ
FUNC_TO_YMINTERVALback to summary
private static final int FUNC_TO_YMINTERVAL
FUNC_TRANSACTION_CONTROLback to summary
private static final int FUNC_TRANSACTION_CONTROL
FUNC_TRANSACTION_IDback to summary
private static final int FUNC_TRANSACTION_ID
FUNC_TRANSACTION_SIZEback to summary
private static final int FUNC_TRANSACTION_SIZE
FUNC_TRANSACTION_UTCback to summary
private static final int FUNC_TRANSACTION_UTC
FUNC_TRANSLATEback to summary
private static final int FUNC_TRANSLATE
FUNC_TRUNCback to summary
private static final int FUNC_TRUNC
FUNC_TRUNCATEback to summary
private static final int FUNC_TRUNCATE
FUNC_UNHEXback to summary
private static final int FUNC_UNHEX
FUNC_UNISTRback to summary
private static final int FUNC_UNISTR
FUNC_UNIX_MILLISback to summary
private static final int FUNC_UNIX_MILLIS
FUNC_UNIX_TIMESTAMPback to summary
private static final int FUNC_UNIX_TIMESTAMP
FUNC_UUIDback to summary
private static final int FUNC_UUID
patternback to summary
private Pattern pattern
sqlTypeForTokenback to summary
private static IntValueHashMap<K> sqlTypeForToken
tokensForTSIPartback to summary
private static IntKeyIntValueHashMap tokensForTSIPart
tsiTokensForStringPartback to summary
private static IntValueHashMap<K> tsiTokensForStringPart

Constructor Detail

FunctionCustomback to summary
private FunctionCustom(int id)

Method Detail

getExtractTokenForTSIPartback to summary
private static int getExtractTokenForTSIPart(int part)
getFunctionExpressionback to summary
public Expression getFunctionExpression()

Overrides org.hsqldb.FunctionSQL.getFunctionExpression.

getSQLback to summary
public String getSQL()

Overrides org.hsqldb.FunctionSQL.getSQL.

Doc from org.hsqldb.Expression.getSQL.

For use with CHECK constraints. Under development. Currently supports a subset of expressions and is suitable for CHECK search conditions that refer only to the inserted/updated row. For full DDL reporting of VIEW select queries and CHECK search conditions, future improvements here are dependent upon improvements to SELECT query parsing, so that it is performed in a number of passes. An early pass should result in the query turned into an Expression tree that contains the information in the original SQL without any alterations, and with tables and columns all resolved. This Expression can then be preserved for future use. Table and column names that are not user-defined aliases should be kept as the HsqlName structures so that table or column renaming is reflected in the precompiled query.

getSQLSimpleback to summary
private String getSQLSimple()
getSQLTypeForTokenback to summary
pack-priv static int getSQLTypeForToken(String string)
getTranslationMapback to summary
private static IntKeyIntValueHashMap getTranslationMap(String source, String dest)
getTSITokenback to summary
private static int getTSIToken(String string)
getValueback to summary
pack-priv Object getValue(Session session, Object[] data)

Overrides org.hsqldb.FunctionSQL.getValue.

isRegularFunctionback to summary
public static boolean isRegularFunction(int tokenType)
isValueFunctionback to summary
public static boolean isValueFunction(int tokenType)
newCustomFunctionback to summary
public static FunctionSQL newCustomFunction(Session session, String token, int tokenType)
regexpParamsback to summary
private static int regexpParams(String params)
resolveTypesback to summary
public void resolveTypes(Session session, Expression parent)

Overrides org.hsqldb.FunctionSQL.resolveTypes.

setArgumentsback to summary
public void setArguments(Expression[] nodes)

Overrides org.hsqldb.FunctionSQL.setArguments.

soundexback to summary
private static char[] soundex(String s)

Returns a four character code representing the sound of the given String. Non-ASCCI characters in the input String are ignored.

This method was rewritten for HSQLDB to comply with the description at http://www.archives.gov/research/census/soundex.html .

Parameters
s:String

the String for which to calculate the 4 character SOUNDEX value

Returns:char[]

the 4 character SOUNDEX value for the given String

translateWithMapback to summary
private static String translateWithMap(String source, IntKeyIntValueHashMap map)