| Home | Previous Lesson: Executing a Stored Procedure Next Lesson: Retrieving Multiple Result Sets |
When connected to the SQL Server, you can execute a stored procedure that is located on a remote server. To do this, you qualify the stored procedure name with the appropriate server and database names. For example, if the SQL Server stored procedure we saw above is residing on Server2 and our application is connected to Server1, we could execute the stored procedure by declaring it as follows:
DECLARE lProc_0001 PROCEDURE FOR Server2.DB1.dbo.Proc2
@Product_Balance = :sle_balance.Text,
@affected_count = :laffected_count OUTPUT ;
A remote stored procedure has a different meaning when connected to a DB2 database via MDI Database Gateway for DB2. Here, a Remote Stored Procedure (RSP) is a customer-written CICS program which can be initiated by a client application, such as PowerBuilder. The CICS program can be written in COBOL II, Assembler, PL/1 or C. RSPs are unique to the MDI Gateway for DB2 or MVS solution.
Here, Server1 sends the request to execute the stored procedure to Server2. Server2 then executes the procedure and sends the results back to Server1 and Server1 returns the results to the client (PowerBuilder application).
| Home | Previous Lesson: Executing a Stored Procedure Next Lesson: Retrieving Multiple Result Sets |