The UTL_RAW system package provides SQL functions for manipulating the RAW data type.
Because regular SQL functions do not operate on RAW data, and PL does not allow overloading between the RAW and CHAR data types, the UTL_RAW system package is essential.
UTL_RAW is not limited to use in a database environment. Therefore, the system package is prefixed with UTL rather than DBMS.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL-compatible mode.
Usage instructions for UTL_RAW
UTL_RAW allows a RAW record to consist of multiple elements. By using the RAW data type, character set conversion is not performed, preserving the original format of the RAW data during remote calls.
Overview of UTL_RAW Subprograms
The following table lists the UTL_RAW subprograms supported by the current version of OceanBase Database and provides brief descriptions.
Subprogram |
Description |
|---|---|
| BIT_AND | YesRAW r1andRAW r2performs a bitwise AND operation on the values and returns the original AND result. |
| BIT_COMPLEMENT | YesRAW rperforms bitwise logical complement on the values in it and returns the result of the complement operation.RAW. |
| BIT_OR | YesRAW r1andRAW r2performs a bitwise logical OR operation on the values and returns the original OR result. |
| BIT_XOR | YesRAW r1andRAW r2performs a bitwise XOR operation on the values and returns the original XOR result. |
| CAST_FROM_BINARY_DOUBLE | WithRAWin binary formatBINARY_DOUBLEValue. |
| CAST_FROM_BINARY_FLOAT | WithRAWThe binary form of the value is returned.BINARY_FLOATValue. |
| CAST_FROM_BINARY_INTEGER | WithRAWin binary format.BINARY_INTEGERValue. |
| CAST_FROM_NUMBER | WithRAWThe binary form of the value is returned.NUMBERValue. |
| CAST_TO_BINARY_DOUBLE | will beRAWBinary representation ofBINARY_DOUBLEConvert value toBINARY_DOUBLE. |
| CAST_TO_BINARY_FLOAT | will beRAWrepresented in binary formBINARY_FLOATConvert the value toBINARY_FLOAT. |
| CAST_TO_BINARY_INTEGER | will beRAWBinary representation ofBINARY_INTEGERConvert value toBINARY_INTEGER. |
| CAST_TO_NUMBER | will beRAWrepresented in binary formatNUMBERConvert value toNUMBER. |
| CAST_TO_RAW | toVARCHAR2Convert the value toRAWValue. |
| CAST_TO_VARCHAR2 | toRAWConvert the value toVARCHAR2Value. |
| COPIES | Returns concatenatedrofnreplicas. |
| COMPARE | compareRAW r1andRAW r2. |
| CONCAT | Up to 12RAWConnected to aRAW. |
| LENGTH | ReturnRAW rThe byte length of . |
| REVERSE | End-to-end reversalRAW rthe byte sequence in it. |
| SUBSTR | ReturnlenNumber of bytes, fromRAW rofposbits. |
