The CAST_FROM_NUMBER function returns a NUMBER value in the binary RAW representation.
Note
Implementation of the NUMBER data type in OceanBase Database differ from that in an Oracle database. The RAW data returned 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 the MySQL mode.
Syntax
UTL_RAW.CAST_FROM_NUMBER (
n IN NUMBER)
RETURN RAW;
Parameters
The parameter n indicates a NUMBER value.
Return values
The binary representation (RAW) of a NUMBER value is returned.
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