execute immediate and connect statement
Hi,
How do you connect to another database via a db link using dynamic sql eg using the execute immediate statement?
i need to do something like;
CREATE OR REPLACE PROCEDURE exec_proc1_remotely AS
BEGIN
EXECUTE IMMEDIATE 'CONNECT user1/mypassword@mydb.world'; --????
app.proc1;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20201, 'exec_proc1_remotely' || SQLERRM);
END;
i am avoiding using scripts by trying to use the above, but i am getting the error "Invalid sql statement" when i run the procedure.
i am using Oracle 11g.
please help.