Oracle Conversion Functions
Conversion functions convert a value of one data type to another data type. This page summarizes conversion functions available in Oracle.
-
ASCIISTR
OracleASCIISTR()
is a built-in function that returns the ASCII version of a given string in the database character set. -
BIN_TO_NUM
OracleBIN_TO_NUM()
is a built-in function that returns the number converted from the bit vector specified by the arguments. -
CAST
OracleCAST()
is a built-in function that converts a given argument from one type to another. This function supports both basic data types and collection types. -
CHARTOROWID
OracleCHARTOROWID()
is a built-in function that converts a given string value to theROWID
data type. -
COMPOSE
OracleCOMPOSE()
is a built-in function that returns the result of applying Unicode normalization (as described in Unicode Standard Definition D117) to the given string parameter. -
CONVERT
OracleCONVERT()
is a built-in function that converts a given string from one character set to another. -
DECOMPOSE
OracleDECOMPOSE()
is a built-in function that returns the result of applying a Unicode decomposition to the given argument. -
HEXTORAW
OracleHEXTORAW()
is a built-in function that converts a hexadecimal value specified as a parameter into a raw value. -
NUMTODSINTERVAL
OracleNUMTODSINTERVAL()
is a built-in function that converts a given number to text inINTERVAL DAY TO SECOND
format. -
NUMTOYMINTERVAL
OracleNUMTOYMINTERVAL()
is a built-in function that converts a given number toINTERVAL YEAR TO MONTH
text. -
RAWTOHEX
OracleRAWTOHEX()
is a built-in function that converts a raw value to a character value that contains its hexadecimal representation. -
RAWTONHEX
OracleRAWTONHEX()
is a built-in function that converts a raw value to a character value containing its hexadecimal representation. -
ROWIDTOCHAR
OracleROWIDTOCHAR()
is a built-in function that converts a given rowid value toVARCHAR2
type. -
ROWIDTONCHAR
OracleROWIDTONCHAR()
is a built-in function that converts a given rowid value to theVARCHAR2
data type. -
SCN_TO_TIMESTAMP
OracleSCN_TO_TIMESTAMP()
is a built-in function that returns an approximate timestamp associated with a given system change number (SCN). -
TIMESTAMP_TO_SCN
OracleTIMESTAMP_TO_SCN()
is a built-in function that returns an approximate system change number (SCN) associated with a given timestamp. -
TO_BINARY_DOUBLE
OracleTO_BINARY_DOUBLE()
is a built-in function that converts the given expression to a double precision floating point number. -
TO_BINARY_FLOAT
OracleTO_BINARY_FLOAT()
is a built-in function that converts the given expression to a binary float. -
TO_BLOB(bfile)
OracleTO_BLOB(bfile)
is a built-in function that converts aBFILE
value to aBLOB
value. -
TO_BLOB(raw)
OracleTO_BLOB(raw)
is a built-in function that converts a givenLONG RAW
andRAW
value to aBLOB
value. -
TO_CHAR(bfile|blob)
OracleTO_CHAR(bfile|blob)
is a built-in function that convertsBFILE
orBLOB
data into the database character set. -
TO_CHAR(character)
OracleTO_CHAR(character)
is a built-in function that convertsNCHAR
,NVARCHAR2
,CLOB
, orNCLOB
data to the database character set. -
TO_CHAR(datetime)
OracleTO_CHAR(datetime)
is a built-in function that converts a given date, time, or interval value to a string based on a specified format. -
TO_CHAR(number)
OracleTO_CHAR(number)
is a built-in function that converts a given numeric value to a value of theVARCHAR2
data type using an optional format parameter. -
TO_CLOB(bfile|blob)
OracleTO_CLOB(bfile|blob)
is a built-in function that convertsBFILE
orBLOB
data to the database character set and returns the data as aCLOB
value. -
TO_CLOB(character)
OracleTO_CLOB(character)
is a built-in function that is used to convertNCLOB
values or other character strings in LOB columns toCLOB
values. -
TO_DATE
OracleTO_DATE()
is a built-in function that converts a given string date to a value of theDATE
data type according to an optional format. -
TO_DSINTERVAL
Oracle’sTO_DSINTERVAL()
is a built-in function that converts a given string parameter into aINTERVAL DAY TO SECOND
type value. -
TO_LOB
OracleTO_LOB()
is a built-in function that convertsLONG
orLONG RAW
values in a given column to LOB values. You can only apply this function toLONG
orLONG RAW
columns and only in the select list of a subquery in anINSERT
statement. -
TO_MULTI_BYTE
OracleTO_MULTI_BYTE()
is a built-in function that converts all single-byte characters in the given parameter to their corresponding multi-byte characters and returns a value of the same data type as the parameter. -
TO_NCHAR(character)
OracleTO_NCHAR(character)
is a built-in function that convertsNCHAR
,NVARCHAR2
,CLOB
, orNCLOB
data to the national character set. -
TO_NCHAR(datetime)
OracleTO_NCHAR(datetime)
is a built-in function that converts the given date, time, or interval value to a string according to the specified format. -
TO_NCHAR(number)
OracleTO_NCHAR(number)
is a built-in function that converts the given numeric value to a value ofVARCHAR2
data type using an optional format parameter. -
TO_NCLOB
OracleTO_NCLOB()
is a built-in function that converts aCLOB
value in a LOB column or other character string to anNCLOB
value. -
TO_NUMBER
OracleTO_NUMBER()
is a built-in function that converts the given argument to a value of data typeNUMBER
. -
TO_SINGLE_BYTE
OracleTO_SINGLE_BYTE()
is a built-in function that converts all multi-byte characters in the given argument to their corresponding single-byte characters and returns a value of the same data type as the argument. -
TO_TIMESTAMP
OracleTO_TIMESTAMP()
is a built-in function that converts a given string parameter to a value of typeTIMESTAMP
. -
TO_TIMESTAMP_TZ
OracleTO_TIMESTAMP_TZ()
is a built-in function that converts the given string argument to aTIMESTAMP WITH TIME ZONE
data type. -
TO_YMINTERVAL
OracleTO_YMINTERVAL()
is a built-in function that converts a given string parameter to a value of typeINTERVAL MONTH TO YEAR
. -
TREAT
OracleTREAT()
is a built-in function used to change the declared type of an expression. -
UNISTR
OracleUNISTR()
is a built-in function that returns the given character data in the national character set. -
VALIDATE_CONVERSION
OracleVALIDATE_CONVERSION()
is a built-in function that is used to determine whether a given expression can be converted to a given data type.