The CAST_FROM_BINARY_INTEGER function returns the BINARY_INTEGER value in RAW binary format.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this function.
Syntax
UTL_RAW.CAST_FROM_BINARY_INTEGER (
n IN BINARY_INTEGER
endianess IN PLS_INTEGER DEFAULT BIG_ENDIAN)
RETURN RAW;
Parameters
| Parameter | Description |
|---|---|
| n | The BINARY_INTEGER value. |
| endianess | The BINARY_INTEGER value that specifies the byte order. The function recognizes the following defined constants:
big_endian. The effect of machine_endian is the same as that of big_endian on a big-endian machine or the same as that of little_endian on a little-endian machine. |
Return value
The binary representation (RAW) of the BINARY_INTEGER value.
Examples
obclient> SELECT UTL_RAW.CAST_FROM_BINARY_INTEGER(0) FROM DUAL;
+-------------------------------------+
| UTL_RAW.CAST_FROM_BINARY_INTEGER(0) |
+-------------------------------------+
| 00000000 |
+-------------------------------------+
1 row in set
obclient> SELECT UTL_RAW.CAST_FROM_BINARY_INTEGER(-2147483648) FROM DUAL;
+-----------------------------------------------+
| UTL_RAW.CAST_FROM_BINARY_INTEGER(-2147483648) |
+-----------------------------------------------+
| 80000000 |
+-----------------------------------------------+
1 row in set
