Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2012
    Posts
    12

    Unanswered: call a procedure from another schema

    i have two different schemas called test1 and test2.In test1 there has a package called pkg1.Within that package there is a procedure called proc1.I want to call proc1 procedure from the test2 package proc2.I used visual studio 2008.how can do this?what is the statement to do this?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    test1.pkg1.proc1;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Owner should first grant EXECUTE privilege on that procedure to another user.

    Here's an Oracle example (I don't use Visual Studio 2008); I hope you'll get the idea.

    First, connected as user SCOTT, I'll create a package that contains a procedure and - at the end - grant privileges to another user (MIKE):
    Code:
    SQL> show user
    USER is "SCOTT"
    SQL>
    SQL> create or replace package pkg1 as
      2    procedure proc1;
      3  end;
      4  /
    
    Package created.
    
    SQL> create or replace package body pkg1 as
      2    procedure proc1 as
      3      begin
      4        dbms_output.put_line('Hello');
      5       end;
      6  end;
      7  /
    
    Package body created.
    
    SQL> grant execute on pkg1 to mike;
    
    Grant succeeded.
    Now, connect as MIKE and execute that procedure:
    Code:
    SQL> connect mike/lion@ora10
    Connected.
    
    SQL> exec scott.pkg1.proc1;
    Hello
    
    PL/SQL procedure successfully completed.
    
    SQL>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •