Creating the TravelRequest Database Table

Create the database table to be used by the TravelRequest mobile business object.

Create the database table from a SQL file:
  1. In Enterprise Explorer, open the Database Connections folder, right-click My Sample Database, and choose Connect. If Connect is not available in the context menu, the database is already connected.
    See Connecting to the Sample Database in Tutorial: Mobile Business Object Development for more information.
  2. From the main menu, select File > New > Other.
  3. Select SQL Development > SQL File, and click Next.
  4. Enter or select the values shown, then click Finish:
    Field Value
    Parent folder Select the HybridApp101 project.
    File name Enter TravelRequest.
    Database server type Select Sybase_ASA_12.x.
    Connection profile name Select My Sample Database.
    Database name Select sampledb.

    new_sql_file
  5. If the new file does not open in the SQL File Editor, open it by double-clicking HybridApp101\TravelRequest.sql in Workspace Navigator. In TravelRequest.sql, copy and paste this code:
    CREATE TABLE TravelRequest (
       trvl_Id                      integer NOT NULL DEFAULT autoincrement,
       trvl_Date                    date NULL,
       trvl_Loc                     varchar(20) NULL,
       est_Cost                     float NULL,
       purpose                      varchar(200) NULL,
       trvl_Status                  varchar(20) NULL, 
       st_Cmmnt                     varchar(200) NULL, 
       PRIMARY KEY CLUSTERED (trvl_Id) 
    );
    
  6. Save TravelRequest.sql and close the editor.
  7. In the WorkSpace Navigator, expand HybridApp101. Right-click TravelRequest.sql and choose Execute SQL Files.
    Sybase Unwired WorkSpace creates a table called TravelRequest in the sampledb database.
  8. In Enterprise Explorer, expand sampledb, expand the Tables folder, and verify that the new TravelRequest table is added.
    If the table is not visible, right-click the Tables folder and choose Refresh.