zoukankan      html  css  js  c++  java
  • 更改某个用户下所有的表中的某个字段替换关键字

    create or replace procedure updateAll is
    ----替换所有的表,并且表中所有的字段
    tmp_table user_tables.TABLE_NAME%type;
    begin
    for rec in (select table_name from user_tables) loop
    select table_name into tmp_table from user_tables where table_name =rec.table_name;
    for r in (select column_name from user_tab_cols where table_name=tmp_table) loop

    execute immediate 'update '
    ||
    tmp_table
    ||
    ' set '
    ||
    r.column_name
    ||
    '= replace( '
    ||
    r.column_name
    ||
    ',''开封'',''深圳'') where '
    ||
    r.column_name
    ||
    ' like ''%开封%'' ';
    commit;
    --- update ACT_GE_BYTEARRAY set rev_ =replace(id_,'开封','深圳') where rev_ like '%开封%'

    end loop;
    end loop;
    end updateAll;

  • 相关阅读:
    网络流
    KMP算法
    光现象
    物理学习须知
    声现象
    常见物理量测量方法
    洛谷 P1373 小a和uim之大逃离
    洛谷 P1242 新汉诺塔
    电磁现象
    磁化
  • 原文地址:https://www.cnblogs.com/auldlangsynezh/p/8032744.html
Copyright © 2011-2022 走看看