Oracle11g [1] :ORA-01427:单行子查询返回多行

Oracle11g [1] :ORA-01427:单行子查询返回多行,oracle11g,Oracle11g,ORA-01427:单行子查询返回多行 SELECT rh_party_branch , rh_doc_no , rh_batch_id , rh_cre_dt , rh_fc_amt , rh_mode_of_pay , rh_off_code , rh_narration , rh_status , rh_cre_user_init , get_policy_no(rh_doc_no)POLI

ORA-01427:单行子查询返回多行

SELECT rh_party_branch
     , rh_doc_no
     , rh_batch_id
     , rh_cre_dt
     , rh_fc_amt
     , rh_mode_of_pay
     , rh_off_code
     , rh_narration
     , rh_status
     , rh_cre_user_init
     , get_policy_no(rh_doc_no)POLICY_NO
     , get_product(rh_doc_no )Product
     , get_class(rh_doc_no,rh_cre_dt)Class_of_bussines
  FROM APT_RCT_HEAD

看起来,get\u policy\u no、get\u product、get\u类中的一个或多个函数有一个返回多行的子查询

作为起点,您可以查看这些函数的代码,其中有一些查询:

             select a,b,c from t where d=(select d from t2 where {conditions})
希望能有帮助


Vishad

请为问题添加更多细节,例如一些样本数据、预期输出,以及访问的各种函数的代码。是的,我有一些函数,下面是一个函数get_policy_no v_receipt_no VARCHAR2 return VARCHAR2 is v_polh_polnum VARCHAR220;开始从apt_open_文件中选择不同于apt_party_ref_no进入v_polh_polnum,其中of_sys_id=从apt_adj_detl中选择ad_of_sys_id,apt_adj_head,其中ad_ah_sys_id=ah_sys_id,ah_adj_no=v_收据号,ad_dru cr='C';返回v_polh_polnum;终止请检查查询是否从apt_adj_detl中选择系统id的ad_,apt_adj_head其中ad_ah_sys_id=ah_sys_id和ah_adj_no=v_receipt_no和ad_dr_cr='C'为您的输入v_receipt提供了单行或多行。它在v_receipt处提供了无效的标识符。您需要将v_receipt替换为您在函数中传递的值,以SQL形式运行查询