You can enter data into an Oracle database using a number of different methods. This tutorial uses Oracle SQL Plus.
Start SQL Plus.
Choose Start > Programs > Oracle - OraDb10g_home1 > Application Development > SQL Plus.
Connect to your consolidated database.
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 appears in the SQL Plus output, but this error 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;
To verify the successful creation of the tables, run the following SQL statement for each table:
SELECT * FROM emp; SELECT * FROM cust;
Leave the consolidated database running.
MobiLink requires an ODBC data source to perform data synchronization. For version 10.0.0, the Oracle ODBC driver must be downloaded. For information, see http://www.ianywhere.com/developer/technotes/odbc_mobilink.html.
Ensure that you know your Instance, Service, and Database names, as these values are required for the ODBC portion of the installation. These values are established at the time of your Oracle installation.
The following steps set up an ODBC configuration for the Oracle consolidated database.
Choose Start > Programs > SQL Anywhere 10 > SQL Anywhere > ODBC Administrator.
The ODBC Data Source Administrator opens.
Click Add on the User DSN tab. The Create New Data Source window appears.
Select iAnywhere Solutions 10 - Oracle, and click Finish.
The ODBC Oracle Driver Setup window appears.
Click the General tab and type the data source name ora_consol. This is the DSN used for connecting to your Oracle database. You will need it later.
Enter the server name. This value depends on your Oracle installation. If the server is on your computer, you may be able to leave this field blank.
Click the Advanced tab, and then enter a Default User Name. For this tutorial you can use system, or any user name with sufficient rights to create objects.
Click OK.
Click OK to close the ODBC Data Source Administrator.
For more information about the Oracle ODBC driver, see iAnywhere Solutions Oracle driver.
For more information about Oracle, see your Oracle documentation.