Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

TO_NUMBER function (extension)

Syntax

TO_NUMBER ( char_expression )

Description

The scalar function TO_NUMBER converts the given character expression to a number value.

Example

SELECT * FROM customer

WHERE TO_NUMBER (SUBSTR (phone, 1, 3)) = 603 ;

Notes

  • The argument to the function must be of type NCHAR or NVARCHAR for Unicode builds and of type CHAR or VARCHAR for ANSI builds.
  • The result is of type NUMERIC.
  • If any of the argument expressions evaluates to null, the result is null.

TOCIndex