日期:2014-05-16  浏览次数:20397 次

批量生成修改表结构VARCHAR长度为3倍的命令
set heading off;
set feedback off;    
set echo off;    
spool c:\export.sql;   
select  'ALTER TABLE ' || TABLE_NAME || ' MODIFY ' || COLUMN_NAME || ' VARCHAR2('|| DATA_LENGTH*3 ||');'  BATCH_MODIFY_VARCHAR from all_tab_columns where owner='IM-ADMIN' AND DATA_TYPE='VARCHAR2' AND DATA_LENGTH<1300 AND TABLE_NAME NOT LIKE 'TM_%'AND TABLE_NAME NOT LIKE 'TS_%'AND TABLE_NAME NOT LIKE 'OF%';   
spool off;