博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
导入操作
阅读量:7053 次
发布时间:2019-06-28

本文共 2175 字,大约阅读时间需要 7 分钟。

上次传了一个游标的缴费 这个再上传个游标的导入 这个是用fetch游标做的

create or replace procedure l_f_daoru_lab_expert (  resultStr out varchar,  v_userid in CHAR) isv_str varchar(500);m number;n number;k number;v_mac l_apply_log.mac%type;v_ip l_apply_log.ip%type;v_tele l_apply_log.tele%type;v_mobilephone l_apply_log.mobilephone%type;v_cnt number;v_expert_no l_lab_expert_temp.expert_no%type;v_expert_desc l_lab_expert_temp.expert_desc%type;cursor c_expert is select expert_no,expert_desc from l_lab_expert_temp where user_id=v_userid ORDER by expert_no asc ;--****************************************************钟冬冬********************************************Begin  --请自行编辑存储过程函数体  select count(distinct(expert_no)) into m from l_lab_expert_temp where user_id=v_userid;   select count(expert_no) into n from l_lab_expert_temp where user_id=v_userid;   if n>m then  ResultStr := 'error: 有重复的专家号,请核对.';    return;   end if;open c_expert;  fetch c_expert into v_expert_no,v_expert_desc;  while c_expert%found loop    select count(*) into v_cnt from l_lab_expert where expert_no=v_expert_no;    if v_cnt>0 then      v_str:=trim(v_str||'专家编号为'||v_expert_no||'已存在
'); end if; fetch c_expert into v_expert_no,v_expert_desc; end loop; close c_expert; if trim(v_str) is not null or trim(v_str) <>'' then ResultStr:=trim(v_str)||'请核对!
'; return; end if; --导入数据 insert into l_lab_expert(expert_no,expert_desc) select expert_no,expert_desc from l_lab_expert_temp where user_id=v_userid ; delete l_lab_expert_temp; --插入日志select distinct(mac) into v_mac from l_lab_mac_temp where trim(member_no)=trim(v_userid);select distinct(ip) into v_ip from l_lab_mac_temp where trim(member_no)=trim(v_userid);select nvl(tele,'无') into v_tele from emp_def where trim(emp_no)=trim(v_userid);select nvl(mobilephone,'无') into v_mobilephone from emp_def where trim(emp_no)=trim(v_userid);insert into l_apply_log(id,op_man,tele,mobilephone,message,op_date,mac,ip)values(l_log.nextval,v_userid,v_tele,v_mobilephone,'导入了专家类别信息',sysdate,v_mac,v_ip);--删除临时表delete from l_lab_mac_temp where trim(member_no)=trim(v_userid); ResultStr := 'success: 导入成功.';End;

  

转载于:https://www.cnblogs.com/devin818/p/5105391.html

你可能感兴趣的文章
window对象 (浏览器对象模型)
查看>>
Loadrunner 关于参数赋值取值的操作
查看>>
C# 实现保留两位小数的方法
查看>>
Http协议4个新的http状态码:428、429、431、511;
查看>>
C#类型简述
查看>>
Go:字符串操作
查看>>
EXCEL 2010学习笔记 —— VLOOKUP函数 嵌套 MATCH 函数
查看>>
android graphics: 2D animation
查看>>
升级 python 2.6.6 系统到 2.7.10 版本
查看>>
start with connect by prior 递归查询用法
查看>>
OS X 10.11 安装Cocoapods
查看>>
MATLAB测试机器零阈值的大小
查看>>
Bootstrap3 栅格系统-列偏移
查看>>
【翻译】Ext JS 4之HelloWorld
查看>>
【Unity Shaders】Vertex Magic —— 访问顶点颜色
查看>>
javascript的with表示什么?
查看>>
Android SDK 目录和作用详解
查看>>
优化查询
查看>>
odoo开发笔记-自定义发送邮件模板
查看>>
19、集合概述
查看>>