Converts the given character expression to a number value.

Syntax

TO_NUMBER ( char_expression )

Notes

  • The argument to the function must be of type CHARACTER.
  • The result is of type NUMERIC.
  • If any of the argument expressions evaluates to NULL, the result is NULL.

Example

This example illustrates the TO_NUMBER function and the SUBSTR function:

Select*
             From pub.customer
             WHERE (CASE SUBSTR(phone,1,1))
                     WHEN '('THEN SUBSTR(phone,2,3)
                     ELSE    substr(PHONE,1,3) ) =603;

Compatibility

Progress extension