Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLSQL insert numeric data types

sinan_ggJun 23 2016 — edited Jun 24 2016

Hi All,

I have a question about following case in Oracle. I try to parse xmltype of data, and insert it to target table.

One of the tag in xmltype column has different numeric format, such as ( '6.029299999999999995e2', '6.11144466688e-1' ) It has not fixed precision,scalar values.

How can i insert it with numeric data type without any rounding ? I tried to insert by using different data types, but only varchar data type column has the same value with source data.

I want to store this column in number format because it will be used in arithmetic operations

create table ss_sample1

(

col1 number,

col2 float,

col3 varchar2(1000),

col4 binary\_double

);

INSERT INTO ss_sample1 (col1, col2, col3, col4)

SELECT '6.029299999999999995e2', '6.029299999999999995e2',

      '6.029299999999999995e2', '6.029299999999999995e2'

 FROM DUAL;

commit;

INSERT INTO ss_sample1 (col1, col2, col3, col4)

SELECT '6.11144466688e-1', '6.11144466688e-1',

      '6.11144466688e-1', '6.11144466688e-1'

 FROM DUAL;

commit;

select * from ss_sample1

Capture.JPG

Thanks,

Sinan

This post has been answered by odie_63 on Jun 23 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2016
Added on Jun 23 2016
3 comments
351 views