begin
for cur in (SELECT t.table_name, t.column_name
FROM USER_TAB_COLUMNS t
where lower(column_name) in ('prod_id',
'feature_id',
'member_prod_id',
'offer_id',
'group_id',
'element_id',
'sno',
'schn_id',
'shop_id',
'o_offer_id',
'rule_id',
'rela_seq',
'o_prod_id',
'price_plan_seq',
'mapping_prod_id',
'price_plan_id',
'catalog_item_id',
'sn_id',
'brand_id',
'seq',
'agreement_id',
'agreement_spec_id',
'duration_id',
'entity_attr_seq',
'entity_id',
'attr_id',
'p_entity_attr_id',
'p_attr_id',
'ref_entity_id',
'entity_attr_v_seq',
'price_id',
'fineitem_id',
'penalty_seq',
'policy_id')
and data_length < 20 and t.TABLE_NAME<>'OM_TPL_PRI_FORMULA'
)
loop
execute immediate 'alter table '||cur.table_name||' modify '||cur.column_name||' VARCHAR2(20)';
end loop;
end;
for cur in (SELECT t.table_name, t.column_name
FROM USER_TAB_COLUMNS t
where lower(column_name) in ('prod_id',
'feature_id',
'member_prod_id',
'offer_id',
'group_id',
'element_id',
'sno',
'schn_id',
'shop_id',
'o_offer_id',
'rule_id',
'rela_seq',
'o_prod_id',
'price_plan_seq',
'mapping_prod_id',
'price_plan_id',
'catalog_item_id',
'sn_id',
'brand_id',
'seq',
'agreement_id',
'agreement_spec_id',
'duration_id',
'entity_attr_seq',
'entity_id',
'attr_id',
'p_entity_attr_id',
'p_attr_id',
'ref_entity_id',
'entity_attr_v_seq',
'price_id',
'fineitem_id',
'penalty_seq',
'policy_id')
and data_length < 20 and t.TABLE_NAME<>'OM_TPL_PRI_FORMULA'
)
loop
execute immediate 'alter table '||cur.table_name||' modify '||cur.column_name||' VARCHAR2(20)';
end loop;
end;
找出用户表中表字段含有上述'feature_id'等的用户表,并修改他们为VARCHAR2(20)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28588485/viewspace-756474/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28588485/viewspace-756474/