string_value Formats - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢
  • SQL Interval Format

    The format for an interval year to month is [+ | -]YY-MM. YY is an integer between 0 and 9999, and MM is an integer between 0 and 11.

  • ISO Duration Format

    The format for a duration is [-]P[n]Y[n]M[n] where n specifies the value of the element (for example, 4Y is 4 years).

    This represents a subset of the ISO duration format and the use of any arguments other than P, Y, and M are ignored. Leading and trailing zeroes are optional. Spaces are not allowed within the element format. Elements may be omitted if they are zero, but at least one element and its number is required.

    A leading negative sign denotes a negative interval. If omitted, the interval is positive. A positive sign is not allowed.

    Element values are integers between 0 and any value that will not cause an interval overflow. The values can exceed their normal time limit. For example, P14M represents 14 months, even though there are 12 months in a year. The ISO duration letter designators have the following meaning (only the P, Y, and M designators are allowed for the YEAR to MONTHS interval):

    ISO Designator Definition
    P Duration. It is always at the beginning.
    Y Year. It follows the number of years.
    M Month. It follows the number of months.

    You can also pass arguments with data types that can be converted to these types using the implicit data type conversion rules that apply to UDFs.

The UDF implicit type conversion rules are more restrictive than the implicit type conversion rules normally used by Vantage. If an argument cannot be converted to the required data type following the UDF implicit conversion rules, it must be explicitly cast.