ORA-01422: 实际返回的行数超出请求的行数

做了个函数的例子,随便写了个,如下:
create or replace function type_function(userno varchar2)
return varchar2
is
type yyy is table of varchar2(10) index by binary_integer;
xx yyy;
vv varchar2(40);
begin
   vv :='1233';
   select mobileid  into xx(20) from tuserinfo where userno=userno;
   vv :=xx(20);

   return vv;

   end;


执行函数
select type_function('00060577') from dual;


居然报:ORA-01422: 实际返回的行数超出请求的行数

通过网上查找,因为我的参数userno和搜索条件一样,现在修改为
create or replace function type_function(userno1 varchar2)
return varchar2
is
type yyy is table of varchar2(10) index by binary_integer;
xx yyy;
vv varchar2(40);
begin
   vv :='1233';
   select mobileid  into xx(20) from tuserinfo where userno=userno1;
   vv :=xx(20);

   return vv;

   end;


正常返回了

你可能感兴趣的:(ora)