ORA-01423:检查实际读取的多余行时出错在一个package(p_tj)里面有
Function GetCodeFromId(s Varchar2) Return Varchar2 Is ---//根据ID返回代码
code Varchar2(60);
Begin
=== Select bookcode Into code From t_book Where Id=s;
Return code;
End GetCodeFromId;
另一个里面调用
=== select Count(Id) Into bookcount from t_SH_BOOK Where p_tj.GetCodeFromId(Id)= '021 ' ;
执行的时候就在这里报错
T_BOOK T_SH_BOOK
CODE ID ID NAME
021 1 1 1111
021 2 1 2222
010 3 2 3333
030 4 3 4444
------解决方案--------------------Select bookcode Into code From t_book Where Id=s;
应该是这里查询的结果大于一条
------解决方案--------------------Select bookcode Into code From t_book Where Id=s出问题
一个id可能对应了多条记录,导致p_tj.GetCodeFromId(Id)有问题