Contents Index CREATE STATISTICS statement CREATE SYNCHRONIZATION SUBSCRIPTION statement [MobiLink]

ASA SQL Reference
  SQL Statements

CREATE SUBSCRIPTION statement [SQL Remote]


Description 

Use this statement to create a subscription for a user to a publication.

Syntax 

CREATE SUBSCRIPTION
TO publication-name [ ( subscription-value ) ]
FOR subscriber-id

publication-nameidentifier

subscription-valuesubscriber-idstring

subscriber-idstring

Usage 

In a SQL Remote installation, data is organized into publications for replication. In order to receive SQL Remote messages, a subscription must be created for a user ID with REMOTE permissions.

If a string is supplied in the subscription, it is matched against each SUBSCRIBE BY expression in the publication. The subscriber receives all rows for which the value of the expression is equal to the supplied string.

In SQL Remote, publications and subscriptions are two-way relationships. If you create a subscription for a remote user to a publication on a consolidated database, you should also create a subscription for the consolidated database on the remote database. The extraction utility carries this out automatically.

Parameters 

publication-name    The name of the publication to which the user is being subscribed. This may include the owner of the publication.

subscription-value    A string that is compared to the subscription expression of the publication. The subscriber receives all rows for which the subscription expression matches the subscription value.

subscriber-id    The user ID of the subscriber to the publication. This user must have been granted REMOTE permissions.

Permissions 

Must have DBA authority.

Side effects 

Automatic commit.

See also 

DROP SUBSCRIPTION statement [SQL Remote]

GRANT REMOTE statement [SQL Remote]

SYNCHRONIZE SUBSCRIPTION statement [SQL Remote]

START SUBSCRIPTION statement [SQL Remote]

sp_subscription procedure

Example 

The following statement creates a subscription for the user p_chin to the publication pub_sales. The subscriber receives all rows for which the subscription expression has a value of Eastern.

CREATE SUBSCRIPTION
TO pub_sales ( 'Eastern' )
FOR p_chin

Contents Index CREATE STATISTICS statement CREATE SYNCHRONIZATION SUBSCRIPTION statement [MobiLink]