PL/SQL (MOSC)

MOSC Banner

update float column from varchar2

edited Sep 20, 2013 11:13AM in PL/SQL (MOSC) 14 commentsAnswered ✓
 Hi all,
create table My_Table (Id Number, Data Varchar2(100));

insert into My_Table values (101,'12345678.25368');
insert into My_Table values (102,'12345678.25369');
insert into My_Table values (103,'12345678.2536S');
insert into My_Table values (104,'12345678.25367');
insert into My_Table values (105,'1234567S.25368');

commit;

select * from My_Table;
      ID DATA                                                                                               
---------- -----------------
       101 12345678.25368                                                                                       
       102 12345678.25369                                                                                       
       103 12345678.2536S                                                                                       
       104 12345678.25367                                                                                       
       105 1234567S.25368 


alter table My_Table add (Data_migration float);

    ID DATA                    DATA_MIGRATION
---------- ----------------   ----------------     
       101 12345678.25368  
       102 12345678.25369  
       103 12345678.2536S  
       104 12345678.25367  
       105 1234567S.25368  


update My_Table set Data_migration=data;


Error starting at line 15 in command:  
update My_Table set Data_migration=data
Error report:                          
SQL Error: ORA-01722: invalid number   

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