如何在pl/sql developer中查看一个包的存储过程的定义
推荐于2017-09-05
展开全部
Connected as SYS
SQL>
SQL> select text from all_source
2 where type='PACKAGE BODY'
3 and owner='SCOTT'
4 order by name,line;
TEXT
--------------------------------------------------------------------------------
PACKAGE BODY myDemoPack AS
FUNCTION prodFunc RETURN myTableType PIPELINED IS
BEGIN
FOR i in 1 .. 5
LOOP
PIPE ROW (myObjectFormat(i,SYSDATE+i,'Row '||i));
END LOOP;
RETURN;
END;
END;
package body pkg_show_emp as
function func_get_emp
return t_ref_cursor
as emp_ref_cursor t_ref_cursor;
begin
open emp_ref_cursor for
select * from emp;
return emp_ref_cursor;
end func_get_emp;
procedure pro_show_emp(ename_in in emp.ename%type) as
v_sign number;
v_empno emp.empno%type;
v_deptno emp.deptno%type;
begin
select 1 into v_sign
from dual
where exists(select 1 from emp where ename=ename_in);
if v_sign=1 then
select empno,deptno into v_empno,v_deptno
from emp where ename=ename_in;
dbms_output.put_line('information of '||ename_in||' are:');
dbms_output.put_line('empno:'||v_empno||',ename:'||ename_in||',de
end if;
exception
when others then
dbms_output.put_line('no data found');
end pro_show_emp;
end pkg_show_emp;
42 rows selected
SQL>
SQL>
SQL> select text from all_source
2 where type='PACKAGE BODY'
3 and owner='SCOTT'
4 order by name,line;
TEXT
--------------------------------------------------------------------------------
PACKAGE BODY myDemoPack AS
FUNCTION prodFunc RETURN myTableType PIPELINED IS
BEGIN
FOR i in 1 .. 5
LOOP
PIPE ROW (myObjectFormat(i,SYSDATE+i,'Row '||i));
END LOOP;
RETURN;
END;
END;
package body pkg_show_emp as
function func_get_emp
return t_ref_cursor
as emp_ref_cursor t_ref_cursor;
begin
open emp_ref_cursor for
select * from emp;
return emp_ref_cursor;
end func_get_emp;
procedure pro_show_emp(ename_in in emp.ename%type) as
v_sign number;
v_empno emp.empno%type;
v_deptno emp.deptno%type;
begin
select 1 into v_sign
from dual
where exists(select 1 from emp where ename=ename_in);
if v_sign=1 then
select empno,deptno into v_empno,v_deptno
from emp where ename=ename_in;
dbms_output.put_line('information of '||ename_in||' are:');
dbms_output.put_line('empno:'||v_empno||',ename:'||ename_in||',de
end if;
exception
when others then
dbms_output.put_line('no data found');
end pro_show_emp;
end pkg_show_emp;
42 rows selected
SQL>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询