The CAST_FROM_BINARY_INTEGER function returns a BINARY_INTEGER value in the binary RAW representation.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
UTL_RAW.CAST_FROM_BINARY_INTEGER (
n IN BINARY_INTEGER
endianess IN PLS_INTEGER DEFAULT BIG_ENDIAN)
RETURN RAW;
Parameters
| Parameter | Description |
|---|---|
| n | A BINARY_INTEGER value. |
| endianess | A BINARY_INTEGER value that indicates the byte order. The defined constants that this function can recognize are as follows:
big_endian. The setting of machine_endian has the same effect as big_endian on a big-endian machine, or has the same effect as little_endian on a little-endian machine. |
Return values
The binary representation (RAW) of a BINARY_INTEGER value is returned.
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