开始
CREATE OR REPLACE PROCEDURE query_emp (p_id IN emp.empno%TYPE, p_name OUT emp.ename%TYPE, p_salary OUT emp.sal%TYPE) IS BEGIN SELECT ename,sal INTO p_name,p_salary FROM emp WHERE empno = p_id; END query_emp;
生成完毕后,可以这样来执行:
DECLARE g_name varchar2(20); g_salary NUMBER(4); BEGIN query_emp(7369,g_name,g_salary); DBMS_OUTPUT.put_line(g_name); DBMS_OUTPUT.put_line(g_salary); END;
结束
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/11/23/2784635.html,如需转载请自行联系原作者