修改表的字段类型

上一篇 / 下一篇  2008-07-10 13:49:43 / 个人分类:Oracle日常维护

第一种方法:
(1).create table new_table as select  to_number(clip_stime) clip_stime,clip_path from vf_clipinfo;这里我们要改字段clip_stime的类型为number
(2).重建相关的索引和约束等.
第二种方法:
(1).exp现有表
(2).truncate table 
(3).alter table table_name  modify column  new_type;
(4).imp DMP文件.
第三种方法:
(1).增加新列 alter table table_name add new_col;
(2).更新新列 update tablename set new_col=old_col;
(3).删除旧列alter table table_name  drop column old_col;
(4).修改新列名为原来表的列名 alter table tablename rename column new_col  to old_col;

 


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-08-30  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 210
  • 日志数: 14
  • 影音数: 1
  • 建立时间: 2008-07-04
  • 更新时间: 2008-08-27

RSS订阅

Open Toolbar