Hi All,
I need a help regarding the value conversion.
I am using oracle 11g r2 version.
BINARY_DOUBLE to NUMBER
BINARY_DOUBLE to VARCHAR2
For your Reference i have created two tables testbinary and test_stg.
desc testbinary;
Name Null Type
---- ---- ---------------
COL1 BINARY_DOUBLE()
Below are values for each table.
select * from testbinary ;
COL1
----------
62.9765
2300142.35
desc test_stg;
Name Null Type
---- ---- ------------------
COL1 NUMBER
COL2 VARCHAR2(255 CHAR)
COL3 DATE
select * from test_stg;
COL1
--------
Requirement is i need to select the data from testbinary table insert to test_stg;
I am using CAST function, below is the query
insert into test_stg(col1) select cast(col1 as number(38,10)) from testbinary;
COMMIT;
select * from test_stg;
OUTPUT: after insert
COL1
---------
62.9765
2300142.3500000001
Here the problem is with "2300142.35" value when inserted to target table test_stg with "2300142.3500000001"
Could any one can help, how to insert the exact value to target table.
Please let me know if you need any further clarification.
Regards,
Sanjib