This tutorial assumes that you have installed the Order Entry (OE) sample database. Information about installing the sample schema can be found in the Oracle documentation or at http://www.oracle.com/technology/obe/obe1013jdev/common/OBEConnection.htm.
The OE database needs to be altered for use with MobiLink. Columns are dropped because they were created as user-defined types. You could translate these user-defined types into types that SQL Anywhere recognizes, but doing so is not relevant to this tutorial. Next, you must grant permission to the OE user to create triggers because MobiLink needs to create a few triggers using OE's credentials.
Connect as the SYS user with SYSDBA privileges using the Oracle SQL Plus application. At a command prompt, run the following command:
sqlplus SYS/your password for sys as SYSDBA |
To drop columns created as user-defined types, run the following commands:
ALTER TABLE OE.CUSTOMERS DROP COLUMN CUST_ADDRESS; ALTER TABLE OE.CUSTOMERS DROP COLUMN PHONE_NUMBERS; ALTER TABLE OE.CUSTOMERS DROP COLUMN CUST_GEO_LOCATION; ALTER TABLE OE.PRODUCT_INFORMATION DROP COLUMN WARRANTY_PERIOD; |
Unlock the OE user and set the password to sql. Run the following command:
ALTER USER OE IDENTIFIED BY sql ACCOUNT UNLOCK; |
To allow the OE user to create triggers, run the following command:
GRANT CREATE ANY TRIGGER TO OE; |
To drop the orders_customer foreign key and create a new foreign key that references the customer_id in the customers table, run the following commands:
ALTER TABLE OE.ORDERS DROP CONSTRAINT ORDERS_CUSTOMER_ID_FK; ALTER TABLE OE.ORDERS ADD CONSTRAINT ORDERS_CUSTOMER_ID_FK FOREIGN KEY (CUSTOMER_ID) REFERENCES OE.CUSTOMERS (CUSTOMER_ID); |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |