Argument Types and Rules - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantage™

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 .