【问题标题】:[1]: ORA-01427: single-row subquery returns more than one row[1]: ORA-01427: 单行子查询返回多于一行
【发布时间】:2014-07-30 20:09:16
【问题描述】:

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

【问题讨论】:

  • 请在问题中添加更多详细信息,例如一些示例数据、预期输出以及访问的各种函数的代码。

标签: oracle11g


【解决方案1】:

看起来,get_policy_no, get_product, get_class 中的一个或多个函数有一个返回多行的子查询。

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

             select a,b,c from t where d=(select d from t2 where {conditions})

希望对你有帮助

维沙德

【讨论】:

  • 是的,我下面有一些函数是一个函数 get_policy_no (v_receipt_no VARCHAR2) return varchar2 is v_polh_polnum VARCHAR2(20) ;开始从 apt_open_file 中选择 DISTINCT of_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_receipt_no 和 ad_dr_cr = 'C');返回 v_polh_polnum ;结束;
  • 请检查查询 select ad_of_sys_id from apt_adj_detl , apt_adj_head where ad_ah_sys_id = ah_sys_id and ah_adj_no = v_receipt_no and ad_dr_cr = 'C' 为您的输入 v_receipt_id 提供单行或多行
  • 它在 v_receipt 处给出了无效的标识符
  • 您需要将 v_receipt 替换为您在函数中传递的值,以便将查询作为 SQL 运行
猜你喜欢
  • 1970-01-01
  • 2017-11-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多