Chapter 4. Tutorialsfor Adaptive Server Anywhere Users
Youcan check the publishing user ID of a database at any time using the
CURRENTPUBLISHER special constant:
SELECT CURRENT PUBLISHER
GRANTREMOTE for
eachdatabase to which
yousend messages
Eachremote database is identified using the GRANT REMOTE statement.
Whetherthe remote database is a personal server or a network server with
manyusers, it needs a single user ID to represent it to the consolidated
database.
Ina mobile workgroup setting, remote users may already be users of the
consolidateddatabase, and so this would require no extra action on the part
ofthe DBA.
TheGRANT REMOTE statement identifies the message system to be used
whensending messages to the recipient, as well as the address.
Toadd 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’ ;
Theaddress string is the directory used to hold messages for field_user,
enclosedin single quotes. Itis taken relative to the SQLRemote
environmentvariable or registry entry. As you have not set this value, the
addressis taken relative to the directory from which the Message Agent
isrun. Youshould run the Message Agent from your tutorial directory for
theaddresses to be interpreted properly.
Forinformation about setting the SQLRemote value, see “Setting
messagetype control parameters” on page 214.
Create publications and subscriptions
Apublication is created using a CREATE PUBLICATION statement. This is
adata 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.
Setup a publicationat
theconsolidated
database
Createa publication named SalesRepData, which replicates all rows of the
tableSalesRep, and some of the rows of the table Customer.
43