The CAST_TO_BINARY_INTEGER function converts a BINARY_INTEGER value in the binary RAW representation into a BINARY_INTEGER value.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
UTL_RAW.CAST_TO_BINARY_INTEGER (
r IN RAW
endianess IN PLS_INTEGER DEFAULT BIG_ENDIAN)
RETURN BINARY_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| r | The binary representation of BINARY_INTEGER. |
| endianess | The BINARY_INTEGER value that represents big_endian or little-endian. The default value is big_endian. |
Return values
A BINARY_INTEGER value is returned.
Examples
obclient> SELECT UTL_RAW.CAST_TO_BINARY_INTEGER('0') FROM DUAL;
+-------------------------------------+
| UTL_RAW.CAST_TO_BINARY_INTEGER('0') |
+-------------------------------------+
| 0 |
+-------------------------------------+
1 row in set
obclient> SELECT UTL_RAW.CAST_TO_BINARY_INTEGER('0F', 1) FROM DUAL;
+----------------------------------------+
| UTL_RAW.CAST_TO_BINARY_INTEGER('0F',1) |
+----------------------------------------+
| 15 |
+----------------------------------------+
1 row in set
obclient> SELECT UTL_RAW.CAST_TO_BINARY_INTEGER('ABCDE') FROM DUAL;
+-----------------------------------------+
| UTL_RAW.CAST_TO_BINARY_INTEGER('ABCDE') |
+-----------------------------------------+
| 703710 |
+-----------------------------------------+
1 row in set