TO_NUMBER Function | Data Types and Literals | Teradata Vantage - 17.10 - TO_NUMBER - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

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

Converts string_expr to a NUMBER data type.

TO_NUMBER is a scalar function whose return value data type is NUMBER.

ANSI Compliance

This statement is a Teradata extension to the ANSI SQL:2011 standard.


  string_expr [, format_arg [, NLS_param ] ]

Syntax Elements

Name of the database where the function is located.

A character expression. string_expr contains a number in the format specified by format_arg. If the conversion fails, NULL is returned.


A character expression.

If this syntax element is not valid, an error is returned.

If this syntax element is NULL, NULL is returned.

For more information, see format_arg Format Elements.

A character expression.

NLS_param specifies characters that are returned by number format elements:
  • Decimal character
  • Group separator
  • Local currency symbol
  • Dual currency symbol
  • International currency symbol
Valid values for param are:
  • CURRENCY = ' ' text ' '
  • DUAL_CURRENCY = ' ' text ' '
  • ISO_CURRENCY= ' ' text ' '

The characters d and g represent the decimal character and group separator respectively. They must be different single-byte characters. Text must be enclosed in apostrophes. Ten characters are available for the currency symbol.

The SDF (Specification for Data Formatting) file is used to determine any default formatting. If NLS_param is specified, it overrides any defaults specified in the SDF file.

If NLS_param is NULL, NULL is returned.