SQL> var x number
SQL> exec :x :=3;
PL/SQL procedure successfully completed.
SQL> print x;
X
----------
3
SQL> exec dbms_output.put_line(x);
BEGIN dbms_output.put_line(x); END;
*
ERROR at line 1:
ORA-06550: line 1, column 28:
PLS-00306: wrong number or types of arguments in call to 'X'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL> exec :x :=10;
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> exec dbms_output.put_line(:x); => 그냥 x 라고만 사용하면 에러가 발생하기 때문에 :x 를 사용한다.
10
PL/SQL procedure successfully completed.
SQL> select * from dept where deptno=:x;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
댓글 없음:
댓글 쓰기