有数据比较麻烦,可以这样
1. create table temptable as select * from yourtable
2. drop yourtable,create new yourtable with new definition
3. inset into yourtable select * from temptable
4. drop table temptable 系统提供了DBMS_REDEFINITION包,你可以试试,我还没用过.
1. create table temptable as select * from yourtable
2. drop yourtable,create new yourtable with new definition
3. inset into yourtable select * from temptable
4. drop table temptable 系统提供了DBMS_REDEFINITION包,你可以试试,我还没用过.
set head off
set pages 0
set feed off
spool 'c:\tmp.sql'
select 'alter table '||table_name||' modify '||column_name||' char(6);' from cols where column_name like 'CODE%';
spool off
@c:\tmp.sql