▣ select into 문
SQL> begin
2 select sum(sal) from emp;
3 end;
4 /
select sum(sal) from emp;
*
ERROR at line 2:
ORA-06550: line 2, column 2:
PLS-00428: an INTO clause is expected in this SELECT statement
SQL> declare
2 sumx number(10);
3 begin
4 select sum(sal) into sumx from emp;
5 dbms_output.put_line(sumx);
6 end;
7 /
29025
PL/SQL procedure successfully completed.
SQL> select sum(sal) from emp;
SUM(SAL)
----------
29025
댓글 없음:
댓글 쓰기