Siebel Analytics Server Administration Guide > Setting Up Disconnected Analytics > Creating and Testing the SQL Anywhere Database Tables >

Write the DDLs to Create the Local Database Tables


Data is stored in the local database in a relational format. Administrators write the DDLs (data definition language) that create the tables in the local database. The Disconnected Analytics Application Manager running on the laptop uses these DDLs to create the tables and set up the appropriate indexes.

On the mobile user's laptop, the Disconnected Analytics Server uses the local database to store and query data. If an application has multiple tables, then you do not need to setup the joins in the database. The joins can be setup in the local repository.

The following two examples show sample DDLs. One is an example of a DDL that creates a table with the appropriate columns and one is an example of a DDL that creates an index for a table.

Example of a DDL File That Creates a Table

The following is an example of a file called SRFlat.sql that creates a table and several columns.

drop table SRFlat;

 

create table SRFlat

 

(OpenDate

Date,

OpenMonth

varchar(20),

OpenYear

varchar(20),

AccountLocation

varchar(50),

AccountOrganization

varchar(50),

AccountType

varchar(50),

AccountName

varchar(50),

Product

varchar(50),

ProductLine

varchar(50),

PartNumber

varchar(50),

AssetNumber

varchar(50),

NumberofSRs

int,

NumberofClosedSRs

int,

NumberofOpenSRs

int,

NumberofPendingSRs

int,

NumberofCancelledSRs

int);

Example of a DDL That Creates an Index for a Table

The following is an example of the contents of a file that creates an index for a table called SRFlatIndex.sql:

DROP index SRFlatindex;

create index SRFlatindex on SRFLat (AccountOrganization,Product);

NOTE:  Data types supported for the database tables are varchar, char, int, decimal, date, timestamp, and numeric(p,s).


 Siebel Analytics Server Administration Guide
 Published: 11 March 2004