ORACLE报错:PLS-00225:子程序或游标'XXX'引用超出范围

ORACLE报错:PLS-00225:子程序或游标'XXX'引用超出范围

 

问题描述

报错信息如下

Error: PLS-00225: 子程序或游标 'P' 引用超出范围
Line: 733
Text: P.CHANGE_TYPE                 ,

Error: PL/SQL: ORA-00904: "P"."CHANGE_REASON": 标识符无效
Line: 733
Text: P.CHANGE_TYPE                 ,

Error: PL/SQL: SQL Statement ignored
Line: 675
Text: INSERT INTO DAP_FLJG_ORGANCHANGE

Error: Hint: Parameter 'P_OBJECT_IDEN' is declared but never used in 'EXTRACT_ORGAN'
Line: 259
Text: PROCEDURE EXTRACT_ORGAN(P_OBJECT_IDEN IN VARCHAR2 --[业务对象标识]

原sql

  PROCEDURE EXTRACT_ORGANCHANGE(P_OBJECT_IDEN IN VARCHAR2 --[业务对象标识]
                                ) AS
  BEGIN
    MZSJH.ORACLE_COMMON.PDU_PUT_LINE('BEGIN INSERT TO  DAP_FLJG_ORGANCHANGE  ');
    --3、数据写入DAP_FLJG_PERSON
    INSERT INTO DAP_FLJG_ORGANCHANGE
      (pid,
       old_id,
       biz_object_id,
       change_sign,
       change_time,
       change_type_code,
       change_type,
       change_reason,
       org_name,
       org_code,
       org_property_code,
       org_property,
       org_sub_property_code,
       org_sub_property,
       business_type_code,
       business_type,
       org_type_code,
       org_type,
       opera_status_code,
       opera_status,
       legal_person_name,
       org_tel,
       legal_person_cer_type_code,
       legal_person_cer_type,
       legal_person_cer_no,
       legal_person_prop,
       post_code,
       org_region_code,
       org_region_street,
       org_region_area,
       org_address,
       build_time,
       operate_time,
       approved_bed_count,
       service_area_range,
       medical_org_type_code,
       medical_org_type,
       total_area,
       green_area,
       building_area,
       invest,
       house_type,
       service_range_code,
       service_range,
       create_time,
       record_flag,
       ID,
       APPID)
      SELECT P.pid,
             P.old_id,
             P.biz_object_id,
             P.change_sign,
             P.change_time,
             P.change_type_code,
             P.CHANGE_TYPE,
             P.CHANGE_REASON,
             P.org_name,
             P.org_code,
             P.org_property_code,
             P.org_property,
             P.org_sub_property_code,
             P.org_sub_property,
             P.business_type_code,
             P.business_type,
             P.org_type_code,
             P.org_type,
             P.opera_status_code,
             P.opera_status,
             P.legal_person_name,
             P.org_tel,
             P.legal_person_cer_type_code,
             P.legal_person_cer_type,
             P.legal_person_cer_no,
             P.legal_person_prop,
             P.post_code,
             P.org_region_code,
             P.org_region_street,
             P.org_region_area,
             P.org_address,
             P.build_time,
             P.operate_time,
             P.approved_bed_count,
             P.service_area_range,
             P.medical_org_type_code,
             P.medical_org_type,
             P.total_area,
             P.green_area,
             P.building_area,
             P.invest,
             P.house_type,
             P.service_range_code,
             P.service_range,
             P.create_time,
             P.record_flag,
             P.ID,
             P.APPID
      
        FROM (select T.*, INFO.pid
                from mzsjh_exc.de_fljg_ORGANCHANGE t,
                     mzsjh_exc.de_etl_temp_ORGAN   info
               where t.biz_object_id = info.biz_object_id
                 and info.system_no = 'FLJG'
                 and t.record_flag = '1'
                 and t.biz_object_id = P_OBJECT_IDEN) p;
    MZSJH.ORACLE_COMMON.PDU_PUT_LINE('FINSH INSERT TO  DAP_FLJG_ORGANCHANGE  ');
  
  END;

原因

select的数据表写错了,在DE_FLJG_ORGAN表里无CHANGE_REASON字段,应该是SELECT  T.* FROM DE_FLJG_ORGANCHANGE T;

你可能感兴趣的:(Oracle,报错)