SQL Remote User's Guide
Tutorials for Adaptive Server Anywhere Users
Tutorial: Adaptive Server Anywhere replication using Interactive SQL and dbxtract
This section describes the steps you need to take to prepare for the tutorial. These steps include the following:
Create the directories and databases required for the tutorial.
Add a table to the consolidated database.
To create the databases and directories for the tutorial
Create a directory to hold the files you make during this tutorial; for example c:\tutorial.
mkdir c:\tutorial
The tutorial uses two databases: a consolidated database named hq.db and a remote database named field.db. Change to the tutorial directory and create these databases using the following statements at a command prompt:
dbinit hq.db dbinit field.db
Create a subdirectory for each of the two user IDs in the replication system. Create these subdirectories using the following statements at a command prompt:
mkdir c:\tutorial\hq mkdir c:\tutorial\field
The next step is to add a pair of tables to the consolidated database.
To add the tables to the consolidated database
Connect to hq.db from Interactive SQL with a user ID of DBA and a password of SQL.
Execute the following CREATE TABLE statement to create the SalesRep table:
CREATE TABLE SalesRep ( rep_key CHAR(12) NOT NULL, name CHAR(40) NOT NULL, PRIMARY KEY ( rep_key ) );
Execute the following CREATE TABLE statement to create the Customer table:
CREATE TABLE Customer ( cust_key CHAR(12) NOT NULL, name CHAR(40) NOT NULL, rep_key CHAR(12) NOT NULL, FOREIGN KEY REFERENCES SalesRep, PRIMARY KEY ( cust_key ) );
You are now ready for the rest of the tutorial.