The CAST_TO_NUMBER function converts a NUMBER value in the binary RAW representation into a NUMBER value.
Note
Implementation of the NUMBER data type in OceanBase Database differ from that in an Oracle database. The input RAW data in the binary representation must be in the internal NUMBER format of OceanBase Database.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
UTL_RAW.CAST_TO_NUMBER (
r IN RAW)
RETURN NUMBER;
Parameters
The parameter n indicates the binary representation of the NUMBER value.
Return values
A NUMBER value is returned.
Examples
obclient> SELECT UTL_RAW.CAST_TO_NUMBER('020000C07B00000000022E1B') FROM DUAL;
+----------------------------------------------------+
| UTL_RAW.CAST_TO_NUMBER('020000C07B00000000022E1B') |
+----------------------------------------------------+
| 123.456 |
+----------------------------------------------------+
1 row in set
obclient> SELECT UTL_RAW.CAST_TO_NUMBER('020000407B00000000022E1B') FROM DUAL;
+----------------------------------------------------+
| UTL_RAW.CAST_TO_NUMBER('020000407B00000000022E1B') |
+----------------------------------------------------+
| -123.456 |
+----------------------------------------------------+
1 row in set