TO_BINARY_DOUBLE(x): Converts x to a BINARY_DOUBLE
SQL> --TO_BINARY_DOUBLE(x): New for Oracle Database 10g. Converts x to a BINARY_DOUBLE.
SQL> CREATE TABLE float_point_demo
2 (dec_num NUMBER(10,2),
3 bin_double BINARY_DOUBLE,
4 bin_float BINARY_FLOAT);
Table created.
SQL>
SQL> INSERT INTO float_point_demo VALUES (1234.56,1234.56,1234.56);
1 row created.
SQL>
SQL> SELECT * FROM float_point_demo;
DEC_NUM BIN_DOUBLE BIN_FLOAT
---------- ---------- ----------
1234.56 1.235E+003 1.235E+003
SQL>
SQL> SELECT dec_num, TO_BINARY_DOUBLE(dec_num) FROM float_point_demo;
DEC_NUM TO_BINARY_DOUBLE(DEC_NUM)
---------- -------------------------
1234.56 1.235E+003
SQL>
SQL> drop table float_point_demo;
Table dropped.
SQL>
SQL>
Related examples in the same category