The CAST_TO_NUMBER function converts a NUMBER value in RAW binary format to a NUMBER.
Note
For the NUMBER type, OceanBase Database implements the type differently from Oracle. The input RAW binary format must be in the NUMBER format used internally by OceanBase Database.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
UTL_RAW.CAST_TO_NUMBER (
r IN RAW)
RETURN NUMBER;
Parameters
The n parameter specifies the binary representation of a NUMBER.
Return value
The function returns a NUMBER value.
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
