Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Change owner inside a procedure? How? (sql+ = conn user/+pass)

675865Nov 25 2009 — edited Nov 25 2009
Is there a way that i can make a procedure or a function that runs in an owner and then changes owners to do diferent things?

If so, how?

Example of what i would want:


--Connected to ownerdb_1
declare

begin

Update mytable set field1='1';

conn ownerdb_2/pass_of_db_2; --connect to ownerdb_2;
Update mytable set field1='1'; -- mytable is from ownerdb_2;

end;



I know i could execute the Update mytable set field1='1'; -- mytable is from ownerdb_2; without connecting to ownerdb_2 as long as i had grants but i want to know if it is possible to connect to a diferent owner inside a procedure/function.

thanks



Don't forget to assign points to those who help you! (Mark the thread Helpful/Correct)
My Homepage
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2009
Added on Nov 25 2009
3 comments
436 views