Chapter 4. Tutorials for Adaptive Server Anywhere Users

You can check the publishing user ID of a database at any time using the

CURRENT PUBLISHER special constant:

SELECT CURRENT PUBLISHER

GRANT REMOTE for Each remote database is identified using the GRANT REMOTE statement. each database to which Whether the remote database is a personal server or a network server with

you send messages many users, it needs a single user ID to represent it to the consolidated database.

In a mobile workgroup setting, remote users may already be users of the consolidated database, and so this would require no extra action on the part of the DBA.

The GRANT REMOTE statement identifies the message system to be used when sending messages to the recipient, as well as the address.

To add a remote user

1.Connect to the database using Interactive SQL, and execute the following statements:

GRANT CONNECT TO field_user

IDENTIFIED BY field_pwd ;

GRANT REMOTE TO field_user

TYPE file ADDRESS ’field’ ;

The address string is the directory used to hold messages for field_user , enclosed in single quotes. It is taken relative to the SQLRemote environment variable or registry entry. As you have not set this value, the address is taken relative to the directory from which the Message Agent is run. You should run the Message Agent from your tutorial directory for the addresses to be interpreted properly.

For information about setting the SQLRemote value, see “Setting message type control parameters” on page 214 .

Create publications and subscriptions

 

A publication is created using a CREATE PUBLICATION statement. This is

 

a data definition language statement, and requires DBA authority. For the

 

tutorial, you should connect to the hq database as user ID DBA, password

 

SQL, to create a publication.

Set up a publication at

Create a publication named SalesRepData, which replicates all rows of the

the consolidated

table SalesRep, and some of the rows of the table Customer.

database

 

43

Page 61
Image 61
Sybase DC38133-01-0902-01 manual Create publications and subscriptions, SQL, to create a publication