应用情况:
1、oracle的gbk导入到utf8的oracle库,需要乘以1.5倍
2、mysql的库导入到utf8的oracle库,需要乘以3倍
set heading off
set space 0
set pagesize 0
set trimout on
set trimspool on
set linesize 2500
spool modify_len.sql
select 'alter table '||table_name||' modify ('||column_name||' '||data_type||'('||ceil(data_length*1.5)||'));'
from user_tab_columns where data_type in ('VARCHAR2','CHAR','NCHAR','NVARCHAR2') and table_name not like 'BIN%' and table_name like 'DSJ%';
spool off
@modify_len.sql
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29911917/viewspace-2149558/
,如需转载,请注明出处,否则将追究法律责任。