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 theROWIDdata 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 SECONDformat. -
NUMTOYMINTERVAL
OracleNUMTOYMINTERVAL()is a built-in function that converts a given number toINTERVAL YEAR TO MONTHtext. -
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 toVARCHAR2type. -
ROWIDTONCHAR
OracleROWIDTONCHAR()is a built-in function that converts a given rowid value to theVARCHAR2data 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 aBFILEvalue to aBLOBvalue. -
TO_BLOB(raw)
OracleTO_BLOB(raw)is a built-in function that converts a givenLONG RAWandRAWvalue to aBLOBvalue. -
TO_CHAR(bfile|blob)
OracleTO_CHAR(bfile|blob)is a built-in function that convertsBFILEorBLOBdata into the database character set. -
TO_CHAR(character)
OracleTO_CHAR(character)is a built-in function that convertsNCHAR,NVARCHAR2,CLOB, orNCLOBdata 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 theVARCHAR2data type using an optional format parameter. -
TO_CLOB(bfile|blob)
OracleTO_CLOB(bfile|blob)is a built-in function that convertsBFILEorBLOBdata to the database character set and returns the data as aCLOBvalue. -
TO_CLOB(character)
OracleTO_CLOB(character)is a built-in function that is used to convertNCLOBvalues or other character strings in LOB columns toCLOBvalues. -
TO_DATE
OracleTO_DATE()is a built-in function that converts a given string date to a value of theDATEdata 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 SECONDtype value. -
TO_LOB
OracleTO_LOB()is a built-in function that convertsLONGorLONG RAWvalues in a given column to LOB values. You can only apply this function toLONGorLONG RAWcolumns and only in the select list of a subquery in anINSERTstatement. -
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, orNCLOBdata 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 ofVARCHAR2data type using an optional format parameter. -
TO_NCLOB
OracleTO_NCLOB()is a built-in function that converts aCLOBvalue in a LOB column or other character string to anNCLOBvalue. -
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 ZONEdata 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.