MobiLink Synchronization User's Guide
Tutorial: Using MobiLink with an Oracle 8i Consolidated Database
Lesson 1: Create your databases
You may enter data into a database using a number of different methods. This tutorial uses Oracle SQL Plus.
Copy the following code into SQL Plus and execute it. These SQL statements drop, create and populate tables in the consolidated database. If there are no tables to drop, an error will appear in the SQL Plus output. This will not affect processing.
create sequence emp_sequence; create sequence cust_sequence; drop table emp; create table emp ( emp_id int primary key, emp_name varchar( 128 ) ); drop table cust; create table cust ( cust_id int primary key, emp_id int references emp(emp_id), cust_name varchar( 128 ) ); insert into emp ( emp_id, emp_name ) values ( emp_sequence.nextval, 'emp1' ); insert into emp ( emp_id, emp_name ) values ( emp_sequence.nextval, 'emp2' ); insert into emp ( emp_id, emp_name ) values ( emp_sequence.nextval, 'emp3' ); commit; insert into cust ( cust_id, emp_id, cust_name ) values ( cust_sequence.nextval, 1, 'cust1' ); insert into cust ( cust_id, emp_id, cust_name ) values ( cust_sequence.nextval, 1, 'cust2' ); insert into cust ( cust_id, emp_id, cust_name ) values ( cust_sequence.nextval, 2, 'cust3' ); commit;
Copy the following code into SQL Plus and execute it. These SQL statements drop and create tables in the remote databases. If there are no tables to drop, an error will appear in the SQL Plus output. This will not affect processing. Synchronization subscriptions and publications are also inserted to define the synchronization parameters for the MobiLink synchronization server.
create table emp ( emp_id int primary key ,emp_name varchar( 128 ) ); create table cust ( cust_id int primary key, emp_id int references emp ( emp_id ), cust_name varchar( 128 ) ); CREATE PUBLICATION emp_cust ( TABLE cust, TABLE emp ); CREATE SYNCHRONIZATION USER ml_user; CREATE SYNCHRONIZATION SUBSCRIPTION TO emp_cust FOR ml_user TYPE TCPIP ADDRESS 'host=localhost';