今天学习oracle的存储过程,实现定义函数并调用,我定义了一个带返回对象的函数,但是却不知道怎么调用?
create or replace function login(name varchar2,password number)
return scott.emp%rowtype
as
yonghu scott.emp%rowtype;
begin
select * into yonghu from scott.emp where ename=name and empno=password;
Exception
when others
then dbms_output.put_line('用户名密码错误或用户不存在!');
return yonghu;
end;执行
select login('SMITH',7369) from dual;
报:无效数据类型。oracle存储function