The CAST_TO_NUMBER function converts a NUMBER value in the binary RAW representation into a NUMBER value.
Description
Implementation of the
NUMBERdata type in OceanBase Database differ from that in an Oracle database. The inputRAWdata in the binary representation must be in the internalNUMBERformat of OceanBase Database.
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