【问题标题】:Oracle PLS-00302 component must be declared必须声明 Oracle PLS-00302 组件
【发布时间】:2016-07-22 13:31:34
【问题描述】:

我收到这样的错误:

java.sql.SQLException:ORA-06550:第 1 行,第 29 列: PLS-00302:必须声明组件“SAVE_DATA_RESTRICTION” ORA-06550:第 1 行,第 7 列: PL/SQL:语句被忽略

这是我的程序:

 procedure save_data_restriction(  p_user_id       in varchar2, 
                                  p_cru_country   in varchar2,
                                  p_cru_region    in varchar2,
                                  p_cru_branch    in varchar2, 
                                  p_banks         in varchar2,
                                  p_global_access in varchar2) is

      l_crp_data_restr   ccrd_gui.crp_data_restriction%ROWTYPE;      

      cursor c_crp_data_restr is
          select *
          from   ccrd_gui.crp_data_restriction cdr 
          where  cdr.user_id = p_user_id;        

  begin
    open  c_crp_data_restr;
    fetch c_crp_data_restr into l_crp_data_restr;
    if c_crp_data_restr%notfound then
      insert into ccrd_gui.crp_data_restriction    (user_id, 
                                                    cru_country, 
                                                    cru_region, 
                                                    cru_branch, 
                                                    banks, 
                                                    global_access)
      values                                       (p_user_id,
                                                    p_cru_country,
                                                    p_cru_region,
                                                    p_cru_branch,
                                                    p_banks,
                                                    p_global_access);
    elsif   nvl(p_cru_country, chr(0))    != nvl(l_crp_data_restr.cru_country, chr(0))    or
            nvl(p_cru_region, chr(0))     != nvl(l_crp_data_restr.cru_region, chr(0))     or
            nvl(p_cru_branch, chr(0))     != nvl(l_crp_data_restr.cru_branch, chr(0))     or
            nvl(p_banks, chr(0))          != nvl(l_crp_data_restr.banks, chr(0))          or
            nvl(p_global_access, chr(0))  != nvl(l_crp_data_restr.global_access, chr(0)) then

      update ccrd_gui.crp_data_restriction
      set cru_country     = p_cru_country,
          cru_region      = p_cru_region,
          cru_branch      = p_cru_branch,
          banks           = p_banks,
          global_access   = p_global_access
      where user_id = p_user_id;     
    end if;
    close c_crp_data_restr;

  end save_data_restriction;

程序调用:

调用 ccrd.crb_customer_pkg.save_data_restriction(?,?,?,?,?,?)

我是 Oracle 开发的新手。感谢您的帮助。

【问题讨论】:

    标签: java oracle procedure


    【解决方案1】:

    save_data_restriction 未在预期路径中声明:

    schema.package.object
    

    您必须在属于 ccrd 模式的 crb_customer_pkg 包中声明您的过程。 而且如果你从这个包外面调用它(好像是这样),你必须声明一个包规范。

    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/packages.htm#i2412

    【讨论】:

      猜你喜欢
      • 2019-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-05
      • 2021-08-13
      • 2021-01-06
      • 2015-04-26
      相关资源
      最近更新 更多