If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > call a procedure from another schema

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-24-12, 23:38
Tharangi Tharangi is offline
Registered User
 
Join Date: Jan 2012
Posts: 10
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?
Reply With Quote
  #2 (permalink)  
Old 01-24-12, 23:50
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
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.
Reply With Quote
  #3 (permalink)  
Old 01-25-12, 01:11
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
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>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On