Contents IndexGRANT PUBLISH statement HELP statement

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 43. Watcom-SQL Statements
      GRANT REMOTE statement

Function

To identify a database immediately below the current database in a SQL Remote hierarchy, who will receive messages from the current database. These are called remote users.

Syntax

     GRANT REMOTE TO userid, ...
          ...    TYPE message-system, ...
          ...    ADDRESS address-string, ...
          ...    [ SEND { EVERY | AT } 'hh:mm' ]

Parameters

     message-system:
          MAP| FILE| VIM| SMTP

Usage

Anywhere. This statement is applicable only to SQL Remote.

Permissions

Must have DBA authority.

Side effects

Automatic commit.

See also

Description

In a SQL Remote installation, each database receiving messages from the current database must be granted REMOTE permissions.

The single exception is the database immediately above the current database in a SQL Remote hierarchy, which must be granted CONSOLIDATE permissions.

The remote user is identified by a message system, identifying the method by which messages are sent to and received from the consolidated user. The currently supported message systems are MAPI and FILE. The VIM message system is expected to be in beta at the time of release. The address-name must be a valid address for the message-system, enclosed in single quotes.

For the FILE message type, the address is a subdirectory of the directory pointed to by the SQLREMOTE environment variable.

The GRANT REMOTE statement is required for the remote database to receive messages, but does not by itself subscribe the remote user to any data. To subscribe to data, a subscription must be created for the user ID to one of the publications in the current database, using the database extraction utility or the CREATE SUBSCRIPTION statement.

The optional SEND EVERY and SEND AT clauses specify a frequency at which messages are sent. The string contains a time that is a length of time between messages (for SEND EVERY) or a time of day at which messages are sent (for SEND AT). With SEND AT, messages are sent once per day.

If a user has been granted remote permissions without a SEND EVERY or SEND AT clause, the Message Agent processes messages, and then stops. In order to run the Message Agent continuously, you must ensure that every user with REMOTE permission has either a SEND AT or SEND EVERY frequency specified.

It is anticipated that at many consolidated databases, the Message Agent will be run continuously, so that all remote databases would have a SEND clause specified. A typical setup may involve sending messages to laptop users daily (SEND AT) and to remote servers every hour or two (SEND EVERY). You should use as few different times as possible, for efficiency.

Example

     GRANT REMOTE TO SamS
     TYPE mapi
     ADDRESS 'Singer, Samuel'

Contents IndexGRANT PUBLISH statement HELP statement