Hi,
I have a pl/sql script that I run from a sqlplus session as 'sysdba' .
During the execution of the script I would like to switch to another user so I can do some db link creation for that user. After this is done the script should return to 'sysdba' for some finishing up.
I tried to use the following:
BEGIN
<do some stuff as sysdba>
execute immediate 'connect ' || in_owner || '/' || v_password;
<create db link for user>
<switch back to sysdba>
END;
However it seems that 'connect' is a command that can not be run with 'execute immediate'.
Any idea how to accomplish this ?
Thanks!