PL/SQL (MOSC)

MOSC Banner

update float column from varchar2

edited Aug 13, 2013 10:38PM in PL/SQL (MOSC) 3 commentsAnswered
 Hi,
I want to update my new column added in table with varchar2 column.. 


I have the below table.

desc MY_TABLE1

Name Null Type         
---- ---- ------------ 
ID        VARCHAR2(20) 

select * from MY_TABLE1;

ID                 
--------------------
123456789.123456789  
123456789.123456789  
123456789.123456789  

3 rows. 


now add one new column in same table as below. 

alter table MY_TABLE1 add (id_migration FLOAT);

desc MY_TABLE1
Name         Null Type         
------------ ---- ------------ 
ID                VARCHAR2(20) 
ID_MIGRATION      FLOAT(126)   


select * from MY_TABLE1;
D                   ID_MIGRATION
-------------------- ------------
123456789.123456789               
123456789.123456789               
123456789.123456789          


when i update float column from varchar2, it is not update after dot(.) charcter..

update MY_TABLE1 set id_migration = id;

select * from MY_TABLE1;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center