展示目录树的存储过程

继续上篇文章: http://yhb3420.iteye.com/blog/676777

--展示所有目录
create or replace procedure showCatalog(v_pid number)
as
cursor c_c is select * from catalog where pid = v_pid;
i binary_integer := 0;
begin
  for c in c_c loop
    while( i < c.clevel ) loop
       dbms_output.put('--');
       i:=i+1;
    end loop;
    i:=0;
    dbms_output.put_line(c.name);
    if(c.isParent = 1)then
        showCatalog(c.id);
    end if;
  end loop;
end;

你可能感兴趣的:(C++,c,C#,Blog)