1个回答
展开全部
创建存储过程
create or replace procedure p_dept(p_deptno in number)
is
cursor cur_emp is select ename,sal,hiredate from emp where deptno=p_deptno;
begin
for x in cur_emp loop
dbms_output.put_line('ename :'||x.ename||', sal :'||x.sal||', hiredate :'||x.hiredate);
end loop;
end;
/
SQL> set serveroutput on
SQL> exec p_dept(20);
ename :SMITH, sal :800, hiredate :17-DEC-80
ename :JONES, sal :2975, hiredate :02-APR-81
ename :SCOTT, sal :3000, hiredate :19-APR-87
ename :ADAMS, sal :1100, hiredate :23-MAY-87
ename :FORD, sal :3000, hiredate :03-DEC-81
PL/SQL procedure successfully completed.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询