cmd창에서부터시작
SQL>sqlplus scott/tiger@localhost:1521/orcl11
SQL>show user;
SQL>variable rc_emp REFCURSOR;
SQL>exec proc_empcursor(:rc_emp);
**여기서 : 콜론 절대 빼 먹으면 안 된다. 변수이기 때문에
SQL> SQL> print rc_emp;
================================================================
C:\Users\ohjih>sqlplus scott/tiger@localhost:1521/orcl11
SQL*Plus: Release 11.1.0.7.0 - Production on 금 12월 8 12:07:19 2023
Copyright (c) 1982, 2008, Oracle. All rights reserved.
다음에 접속됨:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show user;
USER은 "SCOTT"입니다
SQL> variable rc_emp REFCURSOR;
SQL> exec proc_empcursor(:rc_emp);
PL/SQL 처리가 정상적으로 완료되었습니다.
SQL> print rc_emp;
EMPNO ENAME SAL HIREDATE
---------- ---------- ---------- --------
7369 SMITH 800 80/12/17
7499 ALLEN 1600 81/02/20
7521 WARD 1250 81/02/22
7566 JONES 2975 81/04/02
7654 MARTIN 1250 81/09/28
7698 BLAKE 2850 81/05/01
7782 CLARK 2450 81/06/09
7788 SCOTT 3000 87/04/19
7839 KING 5000 81/11/17
7844 TURNER 1500 81/09/08
7876 ADAMS 1100 87/05/23
EMPNO ENAME SAL HIREDATE
---------- ---------- ---------- --------
7900 JAMES 950 81/12/03
7902 FORD 3000 81/12/03
7934 MILLER 1300 82/01/23
14 개의 행이 선택되었습니다.