getok

来源:互联网 发布:淘宝刷单视频教学视频 编辑:程序博客网 时间:2024/06/10 05:12

create or replace procedure getok
(
       idss in varchar,
       flag out integer
)
as
cursor mycur is select ids,name,class1,class2,class3,class4,class5,class6 from aaa where ids=idss;
vempno aaa.ids%type;
vename aaa.name%type;
class1 aaa.class1%type;
class2 aaa.class2%type;
class3 aaa.class3%type;
class4 aaa.class4%type;
class5 aaa.class5%type;
class6 aaa.class6%type;
begin
open mycur;
loop
fetch mycur into vempno,vename,class1,class2,class3,class4,class5,class6;
exit when mycur%notfound;
if mycur%found then
   begin
    insert into ok values(vempno,vename,class1,class2,class3,class4,class5,class6);
    exception when others then
    dbms_output.put_line('重复了==='||vempno);
    end;
end if;
end loop;
dbms_output.put_line('I Found You!'||mycur%rowcount||'行');
close mycur;
    flag:='1';
    exception when others then
    flag:='0';
end getok;
/

原创粉丝点击