Class DBConvertExpr

All Implemented Interfaces:
ColumnExpr, DBPreparable

public class DBConvertExpr extends DBAbstractFuncExpr
This class is used to convert a value to a different data type. This function uses the DBMSHandler.getConvertPhrase function to obtain a conversion template.

There is no need to explicitly create instances of this class.
Instead use DBColumnExpr.convertTo(DataType)

Author:
doebele
  • Constructor Details

    • DBConvertExpr

      public DBConvertExpr(DBColumnExpr expr, DataType dataType, Object format)
      Constructs a DBDecodeExpr
      Parameters:
      expr - the expression to be converted
      dataType - the target data type
      format - optional formatting information
  • Method Details

    • getFunctionName

      protected String getFunctionName()
      Description copied from class: DBAbstractFuncExpr
      returns the name of the function
      Specified by:
      getFunctionName in class DBAbstractFuncExpr
      Returns:
      the function name
    • addSQL

      public void addSQL(DBSQLBuilder sql, long context)
      Description copied from class: DBExpr
      Used to build the SQL command. SQL for this expression must be appended to StringBuilder.
      Specified by:
      addSQL in class DBExpr
      Parameters:
      sql - the string buffer used to build the sql command
      context - context flag for this SQL-Command (see CTX_??? constants).