Search results
Definition and Usage. The CONVERT () function converts a value (of any type) into a specified datatype. Tip: Also look at the CAST () function. Syntax. CONVERT (data_type (length), expression, style) Parameter Values. Technical Details. More Examples. Example. Convert an expression from one data type to another (varchar):
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 example displays a date and time as character data, uses CAST to change the character data to the datetime data type, and then uses CONVERT to change the character data to the datetime data type.
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.
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:
8 kwi 2013 · Need some help in converting numbers: select to_char(a, '99D99') , to_char(a, '90D99') from ( select 50 a from dual union select 50.57 from dual union select 5.57 from dual union select 0.3...