This Oracle tutorial explains how to use the Oracle/PLSQL TO_NUMBER function with syntax and examples.
The Oracle/PLSQL TO_NUMBER function converts a string to a number.
The syntax for the TO_NUMBER function in Oracle/PLSQL is:
The string that will be converted to a number.
Optional. This is the format that will be used to convert string1 to a number.
Optional. This is the nls language used to convert string1 to a number.
The TO_NUMBER function returns a numeric value.
The TO_NUMBER function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle TO_NUMBER function examples and explore how to use the TO_NUMBER function in Oracle/PLSQL.
For example:
Since the format_mask and nls_language parameters are optional, you can simply convert a text string to a numeric value as follows: