Purpose
TO_BLOB() converts LONG RAW and RAW values to BLOB values.
Syntax
TO_BLOB( raw_value )
Parameters
raw_value is of the LONG RAW or RAW data type.
Return type
The return type is BLOB.
Examples
Assume that you have created the tbl_raw table. Convert RAW values in the table to BLOB values and return the lengths in byte.
obclient> SELECT COL_RAW,LENGTHB(COL_RAW) "LENGTHB_RAW",LENGTHB(TO_BLOB(COL_RAW)) "LENGTHB_BLOB"
FROM tbl_raw;
+------------------+-------------+--------------+
| COL_RAW | LENGTHB_RAW | LENGTHB_BLOB |
+------------------+-------------+--------------+
| 0ABC | 4 | 2 |
| 0123456789ABCDEF | 16 | 8 |
+------------------+-------------+--------------+
2 rows in set