--批量修改字段数据类型
select 'ALTER TABLE PAYONLINE.'||table_name||' MODIFY('||column_name||' NUMBER(21,4)) ;'
from dba_tab_columns where wner='PAYONLINE' and data_type='FLOAT'
from dba_tab_columns where wner='PAYONLINE' and data_type='FLOAT'
--批量修改约束名
select * from dba_constraints where wner='PAYONLINE' AND constraint_type='P' and constraint_name like '%SYS%'
select 'ALTER TABLE '||table_name||' RENAME CONSTRAINT '||constraint_name||' TO PK_'||table_name||' ;'
from dba_constraints where wner='PAYONLINE' AND constraint_type='P' and constraint_name like '%SYS%'
from dba_constraints where wner='PAYONLINE' AND constraint_type='P' and constraint_name like '%SYS%'
--批量修改索引名
select 'ALTER INDEX '||index_name||' RENAME TO '||'PK_'||table_name||' ;'
from dba_constraints where wner='PAYONLINE' AND constraint_type='P' and index_name like '%SYS%'
select 'ALTER INDEX '||index_name||' RENAME TO '||'PK_'||table_name||' ;'
from dba_constraints where wner='PAYONLINE' AND constraint_type='P' and index_name like '%SYS%'
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25198367/viewspace-751127/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25198367/viewspace-751127/