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