Oracle8i SQL Reference
Release 2 (8.1.6)

A76989-01

Library

Product

Contents

Index

Prev Up Next

Functions, 104 of 121


TO_NUMBER

Syntax


Purpose

TO_NUMBER converts char, a value of CHAR or VARCHAR2 datatype containing a number in the format specified by the optional format model fmt, to a value of NUMBER datatype.

Example 1

UPDATE emp SET sal = sal + 
   TO_NUMBER('100.00', '9G999D99')
   WHERE ename = 'BLAKE';

The 'nlsparams' string in this function has the same purpose as it does in the TO_CHAR function for number conversions.

See Also:

"TO_CHAR (number conversion)"

Example 2

SELECT TO_NUMBER('-AusDollars100','L9G999D99',
   ' NLS_NUMERIC_CHARACTERS = '',.''
     NLS_CURRENCY            = ''AusDollars''
   ') "Amount"
     FROM DUAL;

    Amount
----------
      -100

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index