Creating UltraLite tables

You can create new tables to hold your relational data, either with SQL statements in Interactive SQL or with Sybase Central.

In UltraLite, you can only create base tables, which you declare to hold persistent data. The table and its data continue to exist until you explicitly delete the data or drop the table. UltraLite does not support global temporary or declared temporary tables.

Note

Tables in UltraLite applications must include a primary key. Primary keys are also required during MobiLink synchronization, to associate rows in the UltraLite database with rows in the consolidated database.

Sybase Central

In Sybase Central, you can perform these tasks while working with a selected database.

To create an UltraLite table (Sybase Central)
  1. Connect to the UltraLite database.

  2. In the left pane, right-click Tables and choose New » Table.

  3. In the What Do You Want To Name The New Table field, type the new table name.

  4. Click Finish.

  5. From the File menu, choose Save Table.

Interactive SQL

In Interactive SQL, you can declare columns while creating a new table.

To create an UltraLite table (Interactive SQL)
  1. Connect to the UltraLite database.

  2. Execute a CREATE TABLE statement.

    For example, the following statement creates a new table to describe the various skills and professional aptitudes of employees within a company. The table has columns to hold an identifying number, a name, and a type (for example, technical, or administrative) for each skill.

    CREATE TABLE Skills (
       SkillID INTEGER PRIMARY KEY,
       SkillName CHAR( 20 ) NOT NULL,
       SkillType CHAR( 20 ) NOT NULL
    );
See also