create or replace procedure proc_query_prior_department
isCursor department_list_nosub is
select dep.id,dep.name,dep.parent from department dep where org_id=7;
union_mc varchar2(200);begin delete from ma_department_role;
commit;
for varDep in department_list_nosub loop for cur in (select t.parent,t.name from department t start with t.id=varDep.id connect by prior t.parent =t.id order by t.id asc) loop
if cur.parent is not null then if(union_mc is null) then
union_mc := cur.name;
else
union_mc :=union_mc||"/"||cur.name;
end if;
end if;
end loop;
insert into ma_department_role(id,name)values(varDep.id,union_mc);
union_mc:=null;
end loop;
commit;end;关于Oracle 数据库update 卡死的问题Oracle %type和%rowtype小实例相关资讯 Oracle教程
- Oracle中纯数字的varchar2类型和 (07/29/2015 07:20:43)
- Oracle教程:Oracle中查看DBLink密 (07/29/2015 07:16:55)
- [Oracle] SQL*Loader 详细使用教程 (08/11/2013 21:30:36)
| - Oracle教程:Oracle中kill死锁进程 (07/29/2015 07:18:28)
- Oracle教程:ORA-25153 临时表空间 (07/29/2015 07:13:37)
- Oracle教程之管理安全和资源 (04/08/2013 11:39:32)
|
本文评论 查看全部评论 (0)