TO_NUMBER function in Oracle

TO_NUMBER is one of the vital Conversion functions of Oracle. It is used to convert a string to a number. The TO_NUMBER function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i and Oracle 8i.

Syntax:

TO_NUMBER ( char,  format_mask, nls_language )

Parameters: char: It is used to specify the string to be converted. format_mask: It is an optional parameter which is used to specify the format to be used for conversion. nls_language: It is an optional parameter which is used to specify the nls language to be used for conversion.

Example:

TO_NUMBER( '1342.67', '9999.99')

Output:

1342.67

Explanation: Here, a string is converted to a number.

Please follow and like us:
Content Protection by DMCA.com