Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to call a procedure from another procedure.

India_vigneshMar 28 2017 — edited Mar 28 2017

I have two database db1 & db2 and i  have created two procedures pr1 in db1 and pr2 in db2. How do i call pr2 from pr1. Both database lies on same server.

Thanks

Vignesh.

Comments

1011931

You should create dblink between db1 and db2.

IN PR1 you can use like this

BEGIN

.

.

PR2_procdure@db_link_name(param1);

.

.

.

.

END;

Rob the Real Relic

My preference would be to create the database link, then create a synonym for the procedure on the 'remote' database.

That way, if the 'remote' database changes, you simply need to create the database link to the new target and change the synonym without having to amend any code calling the 'remote' procedure.

This is, of course, most beneficial if the 'remote' procedure is called from multiple pieces of code.

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 25 2017
Added on Mar 28 2017
2 comments
696 views