oracle编写个函数()

oracle编写个函数(在线等)
在Oracle中创建一个函数,该函数根据输入的参数i_empno(表示员工编号)来判断表emp中是否存在该员工的信息,如果存在返回字符串,“存在!”,如果不存在,返回字符串“不存在!”。
提示:
表emp的结构为(empno NUMBER(4),
ename
VARCHAR2(20),sal
NUMBER,deptno NUMBER(2)).

------解决方案--------------------
SQL code

set serveroutput on;


create or replace procedure test_pro(i_deptno in number)
is 
 lv_dept_value varchar2(10);
begin
  select dname into lv_dept_value from dept where deptno=i_deptno;
  dbms_output.put_line('部门名称:'||lv_dept_value); 
exception 
  when no_data_found then
    dbms_output.put_line('未找到相关的部门!'); 
end;