A basic example using request functions

In this example, a client application at the replicate (Sydney) site executes the stored procedure upd_publishers_pubs2_req, which makes no changes to the replicate database but causes an associated stored procedure, upd_publishers_pubs2, to execute and change data on the primary (Tokyo) site. upd_publishers_pubs2_req is an empty-body stored procedure.

Perform these tasks to create a request function. No subscriptions are necessary at the primary database; function executions at a site other than the primary for the replication definition automatically flow to the primary site.

At the replicate site:

The empty-body procedure either does nothing or displays a message indicating a pending update. It may have a different name than the associated stored procedure in the primary database.

At the primary site:

Once the primary data has been updated via the replication of the request stored procedure, data can be delivered to replicate sites (including the requestor) via either table replication or applied function replication.

NoteIt is not necessary to create a subscription for a request function.

Figure 3-12: Request functions

In Figure 3-12, a client application at the replicate site executes an empty-body stored procedure, which makes no changes to the replicate database, but causes an associated stored procedure to execute and change data on the primary site.