为什么写这个存储过程,已经在我的<MySql中一个简单的存储过程刷数据库数据>已经说过了,这里不赘述了.


两张表,一张表字段为空的话,就从另外一张表字段取数据更新.代码如下:

create or replace procedure My_test_proce
as
  cursor test_cur is select Id from test_table_tmp where content is null or content = '';--<mysql这篇文章里这多取了content>
begin 
   
  for a in test_cur loop
      update test_table_tmp set content = (select content from 另外一个表 where ID =a.Id) where id = a.Id
      commit;
  end loop;
end;


--调用存储过程
begin
  My_test_proce();
end;


这个我这边没有测试对错.朋友测试了.应该没有什么问题.写完mysql和orcale,突然感觉同样一个功能实现,Mysql实现起来就显复杂点.


Orcale中一个简单的存储过程刷数据库数据

相关文章:

  • 2022-01-17
  • 2021-12-19
  • 2021-07-09
  • 2021-06-13
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2021-06-14
  • 2021-07-13
  • 2021-12-10
  • 2022-12-23
  • 2021-08-18
相关资源
相似解决方案