• plsql pipe


    create or replace type Arr as table of varchar2(500);
    create or replace function getApproverByRole2(busi_dept_id IN NUMBER,
                                    role_code    IN VARCHAR2) RETURN Arr pipelined AS
      v_org_id NUMBER;
    BEGIN
      begin
        select org_id
          into v_org_id
          from sys_dept_ sd
         where sd.id = busi_dept_id;
      exception
        when others then
          v_org_id := null;
      end;

        for person in (SELECT u.*
                            FROM sys_user_      u,
                                 sys_role_      r,
                                 sys_user_role_ ur,
                                 sys_role_org_  rorg
                           WHERE u.id = ur.user_id
                             AND r.id = ur.role_id
                             AND r.id = rorg.role_id
                             AND r.role_code = role_code
                             AND rorg.org_id = v_org_id) loop
          pipe row(person.user_name);
        end loop;
      return;
    END;

    select column_value  from table(cast(getApproverByRole2(1456837,'APP_HR') as Arr ));


  • 相关阅读:
    FirstApp,iphone开发学习总结
    FirstApp,iphone开发学习总结7,相机
    FirstApp,iphone开发学习总结6,Navigation的使用
    FirstApp,iphone开发学习总结1,UIview添加UIimage
    oracle 12cR2 RAC deconfig CRS过程记录
    Activex word
    图片灰度化。
    vb word
    加密
    页面内打开word 组件。
  • 原文地址:https://www.cnblogs.com/rigid/p/12489620.html
Copyright © 2020-2023  润新知