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;

  • 相关阅读:
    子查询
    视频工作工具链
    视频拆帧与组帧
    二叉树
    回溯法
    windows配置编译器
    C++工厂模式
    C++单例模式
    HTML学习记录
    C++代码规范
  • 原文地址:https://www.cnblogs.com/auldlangsynezh/p/8032744.html
Copyright © 2011-2022 走看看