Argument Types and Rules

Teradata Vantage™ SQL Functions, Expressions, and Predicates

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

Refer to the following table for rules regarding WIDTH_BUCKET arguments.

If an argument cannot be implicitly converted to an acceptable type, an error is reported. For more information, see Teradata Vantage™ Data Types and Literals, B035-1143.

Data Type Rules
Numeric WIDTH_BUCKET accepts all numeric data types as arguments. The arguments value_expression, lower_bound, and upper_bound are converted to REAL before processing. The partition_count argument is converted to INTEGER before processing.
Character WIDTH_BUCKET accepts character strings that represent numeric values, and converts the character strings to the appropriate numeric type.
  • TIME, TIMESTAMP, or Period
  • INTERVAL
  • BYTE or VARBYTE
  • BLOB or CLOB
  • CHARACTER or VARCHAR if the server character set is GRAPHIC
WIDTH_BUCKET does not accept these types of arguments.
UDT
  • The UDT must have an implicit cast to any of the following predefined types:

    Numeric

    Character

    DATE

    To define an implicit cast for a UDT, use the CREATE CAST statement and specify the AS ASSIGNMENT clause. For more information, see Teradata Vantage™ Data Types and Literals, B035-1143.

  • Implicit type conversion of UDTs for system operators and functions, including WIDTH_BUCKET, is a Teradata extension to the ANSI SQL standard. To disable this extension, set the DisableUDTImplCastForSysFuncOp field of the DBS Control Record to TRUE. For details, see Teradata Vantage™ - Database Utilities , B035-1102 .