0
votes

I received error like this:

java.sql.SQLException: ORA-06550: line 1, column 29: PLS-00302: component 'SAVE_DATA_RESTRICTION' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored

This is my procedure:

 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;

Procedure call:

call ccrd.crb_customer_pkg.save_data_restriction(?,?,?,?,?,?)

I am new in oracle development. Thanks for any help.

1

1 Answers

1
votes

save_data_restriction is not declared in the expected path :

schema.package.object

You must declare your procedure in the crb_customer_pkg package belonging to the ccrd schema. And if you call it outside from this package (it seems to be the case), you must declare a package specification.

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