(1)set serveroutput on
实现plsql developer 打印输出
(2)如何查看存储过程,存储函数,触发器的内容
查 user_sources表
eg:查询GET_DEPT_SUMSAL这个存储函数的内容
SQL> desc user_source
名称 是否为空? 类型
----------------------------------------- -------- ----------------------------
NAME VARCHAR2(30)
TYPE VARCHAR2(12)
LINE NUMBER
TEXT VARCHAR2(4000)
SQL> select text from user_source where name = 'GET_DEPT_SUMSAL';
TEXT
--------------------------------------------------------------------------------
function get_dept_sumsal(v_deptno number)
return number
is
sumsal number(10):=0;
cursor emp_sal_cursor is select sal from emp where deptno =v_deptno;
begin
for c in emp_sal_cursor loop
sumsal := c.sal + sumsal;
end loop;
return sumsal;
end;
(3) 注意 'GET_DEPT_SUMSAL'; 这里大写加引号引起来