Db2 – How to call Oracle’s stored procedure from DB2 stored procedure

db2dblinkoraclestored-procedures

I am new to writing stored procedures and wondering if it's possible to call a Oralce' stored procedure from DB2 stored procedure.

I have a scenario where a trigger on a DB2 table will invoke a DB2 stored procedure. And further this stored procedure have to call to connect with Oracle DB to do some certain operation (a stored procedure).

Is my understanding is right, and can Oracle's stored procedure can be called through DB Link?

Edit: The version of DB2 is 9.7 and my platform is AIX 6.

Best Answer

Depending on the DB2 platform, it may indeed be possible to call an Oracle (or other database) stored procedure from a DB2 stored procedure. With DB2 for Linux, Unix, and Windows the process of setting up communication with a foreign data source is called federation. You can read more about this in the manual: http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.swg.im.iis.fed.sysconfig.doc/topics/iiyfafsporc.html