Home » SQL & PL/SQL » SQL & PL/SQL » Unable to update a table at remote db in named pl/sql procedure
Unable to update a table at remote db in named pl/sql procedure [message #611108] Thu, 27 March 2014 12:58 Go to next message
sonalpatel_cse
Messages: 1
Registered: March 2014
Junior Member
Hi All,

I am unable to update a table at remote db within my plsql named procedure.

its giving an error : table or view does not exist.

if I am writing same statements in begin-declare-end block, its working fine. however, same statements do not work with named procedure.

Can anyone please help and suggest, what are the permissions required for Named procedure to update a table in remote db.

Thanks!

[Updated on: Thu, 27 March 2014 12:59]

Report message to a moderator

Re: Unable to update a table at remote db in a pl/sql block [message #611109 is a reply to message #611108] Thu, 27 March 2014 13:02 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to the forum.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and please read http://www.orafaq.com/forum/t/174502/102589/

privilege acquired via ROLE does NOT apply within named PL/SQL procedures.

>if I am writing same statements in begin-declare-end block, its working fine.
prior to testing above again, then first do as below

SET ROLE NONE
I expect the same error is the result.

use COPY & PASTE so we can see exactly what you do & how Oracle responds
Re: Unable to update a table at remote db in named pl/sql procedure [message #611114 is a reply to message #611108] Thu, 27 March 2014 13:27 Go to previous message
Solomon Yakobson
Messages: 3273
Registered: January 2010
Location: Connecticut, USA
Senior Member
It has nothing to do with remote table. Remote table is accessed via db link which has embedded username and password, so it doesn't matter anonymous or named block. I am almost positive your code also references local objects. And you are granted access to one or more of these local objects not directly but via role. Stored procedure compilation ignores roles. That's why you get "table or view does not exist". Ask DBA to grant you privileges on local objects referenced in procedure directly, not via role.

SY.
Previous Topic: use of EXTEND in Collection in NESTED TABLES
Next Topic: Sorting Issue
Goto Forum:
  


Current Time: Fri Apr 19 20:01:20 CDT 2024