Oracle TO_CHAR(bfile|blob) Function
Oracle TO_CHAR(bfile|blob) is a built-in function that converts BFILE or BLOB data into database character set.
Oracle TO_CHAR(bfile|blob) Syntax
Here is the syntax for Oracle TO_CHAR(bfile|blob) function:
TO_CHAR( { bfile | blob } [, csid] )
Parameters
bfile | blob-
Required. The
BFILEorBLOBdata to be converted. csid-
Optional. It specifies the character set ID of the
BFILEorBLOBdata. If the character set of theBFILEorBLOBdata is the database character set, you can specify a value of 0 forcsidor omit thecsidparameter entirely.
Return Value
Oracle TO_CHAR(bfile|blob) function returns the given BFILE or BLOB data in the database character set.
The return value of TO_CHAR(bfile|blob) is always VARCHAR2. If the returned value is too large to fit in the VARCHAR2 data type, the data is truncated.
Oracle TO_CHAR(bfile|blob) Examples
Here is a hypothetical example that takes the BFILE column media_col using character set ID 873 in table media_tab as input. The example returns a VARCHAR2 value using the database character set.
SELECT TO_CHAR(media_col, 873)
FROM media_tab;
Conclusion
Oracle TO_CHAR(bfile|blob) is a built-in function that converts BFILE or BLOB data into the database character set.