Oracle批量更新
来源:互联网 发布:锐捷mac地址绑定错误 编辑:程序博客网 时间:2024/06/09 17:19
①导出批量更新SQL
select CONCAT(CONCAT(CONCAT(CONCAT('update test_a set a_date=', b_date), 'where a_id='), b_id), ' and a_flag=1;') from test_b;
②批量更新数据
#方法一 update test_a a set a.a_date = (select b.b_date from test_b b where a.a_id = b.b_id and a.a_flag = 1); #方法二begin for r in (select a.rowid, b.b_date from TEST_A a, test_b b where a.a_id = b.b_id and a.a_flag =1) loop update TEST_A t set t.a_date = r.b_date where t.rowid = r.rowid; end loop;end;#方法三create or replace procedure test as type temp_record IS record(b_id test_b.b_id%type, b_date test_b.b_date%type ); type temp_record_table IS table OF temp_record; tmp temp_record_table ;begin SELECT b.b_id, b.b_date BULK COLLECT INTO tmp FROM test_b b; FOR I IN 1 .. tmp.COUNT LOOP UPDATE TEST_A a SET a.a_date = tmp(I).b_date WHERE a.a_id = tmp(I).b_id AND a.a_flag = 1; END LOOP;end;#方法四merge into TEST_A ausing test_b bon (a.a_id = b.b_id and a.a_flag = 1)when matched then update set a.a_date = b.b_date;
阅读全文
0 0
- Oracle批量更新数据
- oracle 批量更新
- ORACLE批量更新方法
- Oracle数据库批量更新
- oracle批量更新数据
- oracle 批量更新数据
- oracle批量更新操作
- oracle批量更新
- mybatis批量更新(oracle)
- oracle 批量更新
- 批量更新数据Oracle
- Oracle批量更新
- Oracle批量更新
- oracle mybatis 批量更新
- oracle批量更新
- mybatis+oracle批量插入,批量更新
- Oracle数据的批量更新
- oracle sql 批量更新 [转]
- ThreadLocal解决SimpleDateFormat线程安全问题
- 二叉树重建
- 常用排序算法--冒泡,插入,选择,希尔,归并,快速
- Jenkins构建本地项目到服务器上自动部署的方法
- json文件 数据导入excel----->(jxl)
- Oracle批量更新
- Linux下守护进程的探究
- Git使用
- 转自百度百科,strncpy函数
- redis 单实例
- 【笔记】微信头条app全栈中html相关处理
- d指针在QT上应用及实现
- debug.keystore文件不存在解决办法
- R语言-关键节点问题-方案一