create or replace noneditionable package body p_stu as
--游标和结构体,包规范中已声明,包体中不用再声明,直接使用。
--实现方法
--实现过程
procedure GetStuList(cid varchar2) as
-- r_stu re_stu; --直接使用包规范中的结构
v_a varchar2(200);
begin
/*
update TEMP_DUIWAITOUZI t set t.b=trim(t.b);
commit;
delete TEMP_DUIWAITOUZI t
where t.b is null and t.c is null or t.b like '对外投资%' or t.b like '序号%';
commit;
*/
for i in (select to_number(t.a) num, t.*, t.rowid
from TEMP_DUIWAITOUZI t
where length(t.b) < 6
order by to_number(t.a)) loop
/*
--找出前一条记录对应的公司
select t1.b from TEMP_DUIWAITOUZI t1 where to_number(t1.a)=
(select max( to_number(tt.a)) from TEMP_DUIWAITOUZI tt where to_number(tt.a)<i.num);
*/
update TEMP_DUIWAITOUZI t2
set t2.b =
(select t1.b
from TEMP_DUIWAITOUZI t1
where to_number(t1.a) =
(select max(to_number(tt.a))
from TEMP_DUIWAITOUZI tt
where to_number(tt.a) < i.num))
where to_number(t2.a) = i.num;
commit;
end loop;
end;
end;
select * from TEMP_DUIWAITOUZI t order by t.a;
select t.b, count(1)
from TEMP_DUIWAITOUZI t
where exists (select 1 from temp_guanliren g where g.a = t.b and g.l like '%股权%')
group by t.b
having count(1) = 1;
select t.b, count(1)
from TEMP_DUIWAITOUZI t
where exists (select 1 from temp_guanliren g where g.a = t.b and g.l like '%股权%')
group by t.b
having count(1) = 2
厚募fund-ian整理
联系客服