Re: help calling procedure in package from different users

From: Gabriel <spidermoon_at_hotmail.com>
Date: Tue, 29 Jan 2008 17:04:12 +0100
Message-ID: <fnnipu$jf0$1@news.rd.francetelecom.fr>

"Ana C. Dent" <anacedent_at_hotmail.com> a écrit dans le message de news: XCHnj.8107$Mg7.3623_at_newsfe12.phx...
> Martin <martin.j.evans_at_gmail.com> wrote in
> news:8d8ce4c8-fe39-41e7-b6e5-dee08441b714_at_b2g2000hsg.googlegroups.com:
>
>> I have a large perl program which connects to oracle and calls
>> procedures in a package using:
>>
>> call user1.package1.procedure1(args);
>>
>> user1 is the owner/creator of "package1".
>>
>> This works when the Perl is connected to the database as user1 and
>> when logged in as user2 who did not create the package. However, the
>> call syntax has a big problem in that NO_DATA_FOUND exceptions are
>> hidden (see
>> http://download.oracle.com/docs/cd/B28359_
> 01/appdev.111/b28370/overview
>> .htm#g1461293 which says "using the CALL statement can suppress an
>> ORA-01403: no data found error".
>>
>> If I replace "call" with:
>>
>> begin user1.package1.procedure1(args); end;
>>
>> then the NO_DATA_FOUND exceptions are not suppressed which is what I
>> want. The problem is the above syntax only works when user2 wants to
>> call the procedure and fails as below for user1 (the package owner):
>>
>> PLS-00302: component 'PACKAGE1' must be declared
>>
>> Is there any way for user1 and user2 to use exactly the same syntax to
>> call procedure1 in package1 owned by user1?
>>
>> Thanks
>>
>
> It might help to create a synonym for USER2.

And grant execute on this object to user2 while being connected as user1. Received on Tue Jan 29 2008 - 10:04:12 CST

Original text of this message