ORA-01422: exact fetch returns more than requested number of rows
Cause: The number specified in exact fetch is less than the rows returned.
Action: Rewrite the query or change number of rows requested
经过严格的验证,这个结果只会返回单条记录,但是却总是提示ora-01422。后来自己看才发现我传递进来的参数的名称和所查询的列明一样。当我修改传递进来的参数名之后,问题得到解决,但是我却没有找到资料,有说关于两个参数一致会出现这样问题的内容。所以很纳闷!
create or replace function get_resource_e_name(Ext_Asset usp_resource.zproj_ref%type) return varchar2 is
ret varchar2(100):=null;
begin
-- dbms_output.put_line(Ext_Asset1);
select e_name into ret
from zProject zp
where zp.ext_asset=Ext_Asset;
return(ret);
end get_resource_e_name;