set serverout on
create or replace procedure emp_proc
(
e_no in employees.employee_id%type,
e_name out employees.first_name%type,
e_sal out employees.salary%type
)
is
begin
select first_name, salary into e_name ,e_sal
from employees
where employee_id =e_no;
dbms_output.put_line(e_name);
if sql%notfound then
dbms_output.put_line('The staff does not exits.');
end if;
end;
/
사번입력을 받아서 EXECUTE EMP_PROC(100) 이런식으로 해서 SELECT 문 조회를 하는데
없는 사번이 나오면 THE STAFF DOES NOT EXITS 문장을 나오게하는 프로시저를 짜고싶습니다.
아무리 생각해도 뭐가 문제인지 잘 모르겠어서 도움을 요청합니다.
PRA-06550: 줄 1, 열74:PLS-00306: wrong number or types of arguments in call to 'EMP_PROC'
ORA-06550: 줄 1, 열74:PL/SQL: Statement ignored
계속 이오류가나오는데 무슨 타입이 틀린건지를 잘모르겠습니다.
감사합니다.
그렇다면 %notfound는 언제 사용할수있는건가요???
http://www.gurubee.net/lecture/1062 여기 들어가보면 select into 문에 %found 를사용하던데 이거는 무슨경우인가요??