The CAST_FROM_NUMBER function returns a NUMBER value in binary RAW format.
Note
For the NUMBER type, OceanBase Database implements the type differently from Oracle Database. The returned RAW value is in the internal NUMBER format of OceanBase Database.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
UTL_RAW.CAST_FROM_NUMBER (
n IN NUMBER)
RETURN RAW;
Parameters
n specifies a NUMBER value.
Return value
The binary representation of the NUMBER value in RAW format.
Examples
obclient> SELECT UTL_RAW.CAST_FROM_NUMBER(123.456) FROM DUAL;
+-----------------------------------+
| UTL_RAW.CAST_FROM_NUMBER(123.456) |
+-----------------------------------+
| 020000C07B00000000022E1B |
+-----------------------------------+
1 row in set
obclient> SELECT UTL_RAW.CAST_FROM_NUMBER(-123.456) FROM DUAL;
+------------------------------------+
| UTL_RAW.CAST_FROM_NUMBER(-123.456) |
+------------------------------------+
| 020000407B00000000022E1B |
+------------------------------------+
1 row in set
