GRANT SUBSCRIBE

From InterBase
Jump to: navigation, search

Go Up to Statement and Function Reference (Language Reference Guide)


A user is granted SUBSCRIBE privilege to subscribe to the subscription in order to track changes on the listed tables:

GRANT SUBSCRIBE ON SUBSCRIPTION <subscription_name> TO <user_name>;

REVOKE SUBSCRIBE ON SUBSCRIPTION <subscription_name> FROM <user_name>;

Important: To set a subscription as active, an application issues a SET SUBSCRIPTION statement.
Argument Description

<subscription_name>

Implied by the user identity of the database

<user_name>

User identify of the database connection

Description: This SET SUBSCRIPTION statement allows multiple subscriptions to be activated and includes an AT clause to denote a destination or device name as a recipient of the subscribed changes. The subscriber user name is implied by the user identity of the database connection. Multiple subscriptions against the same schema object for a user, via the AT clause, are available for two reasons:

First, each subscription for a user may connote a separate device among many that have a disconnected interest in a change set that is queried independently at different times for different purposes.

Second, some multiuser applications use pooled database connections under the umbrella of a single user name (for example CRM_User or even SYSDBA). In these cases, an alternate identifier must be provided to distinguish which subscription should be used to query a change set. That additional identifier can be thought of as a destination or a "device name".

Example: This is to grant subscribe privileges to that user:

GRANT SUBSCRIBE ON SUBSCRIPTION Subscribed_Inserts TO smartphone_user;
GRANT SUBSCRIBE ON SUBSCRIPTION Customer_Deletes TO smartphone_user;

See Also

Advance To: