必须声明Oracle PLS-00302组件

时间:2016-07-22 13:31:35

标签: java oracle procedure

我收到了这样的错误:

  

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开发的新手。谢谢你的帮助。

1 个答案:

答案 0 :(得分:0)

save_data_restriction未在预期路径中声明:

    var a = [];
    $("input:checked").each(function() {
        a.push($(this).val());
    });
    var str = a.join(', ');

您必须在属于ccrd架构的schema.package.object 包中声明您的过程。 如果你从这个包中调用它(似乎是这种情况),你必须声明一个包规范。

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