如下题 请经常写存储过程 懂数据库Oracle 或者你知道如何写都帮帮我
来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/05/21 09:04:53
如下题 请经常写存储过程 懂数据库Oracle 或者你知道如何写都帮帮我
更新khexpinfo表的历史数据customer_id 的值,根据khexpInfo表的id与centerMaterialuseDetail表export_Uid关联,--centerMaterialuseDetail表的batchinfoUId与Batchinfo表的fuid关联,得到customer_id--用distinct关键字,如果结果记录数大于1则不需要处理,--否则就将khexinfo表的customer_id更新为所查出的customer_Id值
-- 先根据khexpinfo的id查询,若记录数大于1则不执行第2条更新语句,否则执行第2条语句更新语句select distinct b.customer_id from centermaterialusedetail c ,batchinfo b where c.export_uid='154461' and c.batchinfo_uid=b.fuid;
update khexpinfo set customer_id=(select distinct b.customer_id from centermaterialusedetail c ,batchinfo b where c.export_uid='154461' and c.batchinfo_uid=b.fuid) where id=154461;
我这样只能一条一条更新,谁会写歌存储过程 ,循环帮我更新,一条一条更新真的不现实啊
更新khexpinfo表的历史数据customer_id 的值,根据khexpInfo表的id与centerMaterialuseDetail表export_Uid关联,--centerMaterialuseDetail表的batchinfoUId与Batchinfo表的fuid关联,得到customer_id--用distinct关键字,如果结果记录数大于1则不需要处理,--否则就将khexinfo表的customer_id更新为所查出的customer_Id值
-- 先根据khexpinfo的id查询,若记录数大于1则不执行第2条更新语句,否则执行第2条语句更新语句select distinct b.customer_id from centermaterialusedetail c ,batchinfo b where c.export_uid='154461' and c.batchinfo_uid=b.fuid;
update khexpinfo set customer_id=(select distinct b.customer_id from centermaterialusedetail c ,batchinfo b where c.export_uid='154461' and c.batchinfo_uid=b.fuid) where id=154461;
我这样只能一条一条更新,谁会写歌存储过程 ,循环帮我更新,一条一条更新真的不现实啊
create procedure test is
cursor custom_list is
select id from khexpinfo;
custom_dic custom_list%ROWTYPE;
my_custom_id in number(20);
begin
for custom_dic in custom_list loop
begin
select distinct b.customer_id into my_custom_id from centermaterialusedetail c ,batchinfo b where c.export_uid=custom_dic.id and c.batchinfo_uid=b.fuid;
update khexpinfo set customer_id=my_custom_id where id=custom_dic.id;
exception when others then
my_custom_id:=0;
end;
end loop;
commit;
end;
cursor custom_list is
select id from khexpinfo;
custom_dic custom_list%ROWTYPE;
my_custom_id in number(20);
begin
for custom_dic in custom_list loop
begin
select distinct b.customer_id into my_custom_id from centermaterialusedetail c ,batchinfo b where c.export_uid=custom_dic.id and c.batchinfo_uid=b.fuid;
update khexpinfo set customer_id=my_custom_id where id=custom_dic.id;
exception when others then
my_custom_id:=0;
end;
end loop;
commit;
end;
如下题 请经常写存储过程 懂数据库Oracle 或者你知道如何写都帮帮我
英语论文提纲的格式我要写一篇英语毕业论文,题目是语序调整与翻译,我不知道该如何写提纲,请好心人帮帮我!十万火急!
有一个初三数学题不会请大家帮帮我要写分析过程
19、20题怎么写你能帮帮我吗
你不知道你不在我身边 我经常默默流泪 英文怎么写
知道三角形三条边怎样画三角形,写过程或者画图告诉我都可以.
必修一62页的作文老师让我们写篇作文,我真的不知道怎么写!请各位帮帮我!你可以教我怎么写,在给我起个头,然后在结尾!我是
这几天一直写作文,我都不知道写什么了.希望各位“神仙哥哥、姐姐”来帮帮我.
我想知道oracle数据库的所有的关键字?
浅析ORACLE数据库的优化方案如何翻译
请写或者找一篇英语文章.要求如下:
我知道你一直都在的英文怎么写?