Search results
TO_CHAR (number) converts n to a value of VARCHAR2 data type, using the optional number format fmt. The value n can be of type NUMBER, BINARY_FLOAT, or BINARY_DOUBLE. If you omit fmt, then n is converted to a VARCHAR2 value exactly long enough to hold its significant digits.
This tutorial shows you how to use the Oracle TO_CHAR() function to convert a DATE or INTERVAL value to a string in a specified format.
TO_CHAR (datetime) converts a datetime or interval value of DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE, INTERVAL DAY TO SECOND, or INTERVAL YEAR TO MONTH data type to a value of VARCHAR2 data type in the format specified by the date format fmt. If you omit fmt, then date is converted to a VARCHAR2 value as follows:
This Oracle tutorial explains how to use the Oracle / PLSQL TO_CHAR function with syntax and examples. The Oracle / PLSQL TO_CHAR function converts a number or date to a string.
TO_CHAR (character) converts NCHAR, NVARCHAR2, CLOB, or NCLOB data to the database character set. The value returned is always VARCHAR2. When you use this function to convert a character LOB into the database character set, if the LOB value to be converted is larger than the target type, then the database returns an error.
8 kwi 2013 · select replace(to_char(a, '90D90'),'.00','') from ( select 50 a from dual union select 50.57 from dual union select 5.57 from dual union select 0.35 from dual union select 0.4 from dual ); Give a look also as this SQL Fiddle for test.
1 cze 2023 · The syntax of the Oracle TO_CHAR function is: TO_CHAR( input_value, [format_mask], [nls_parameter] ) Parameters. The parameters of the TO_CHAR function are: input_value (mandatory): This is the value to convert into a String type. This is the main input to the function, and this value can either be a DATE type or any of the Number types.