17.10 - Argument Types and Rules - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

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
  • BLOB or CLOB
  • CHARACTER or VARCHAR if the server character set is GRAPHIC
WIDTH_BUCKET does not accept these types of arguments.
  • The UDT must have an implicit cast to any of the following predefined types:




    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 .