In this tutorial, you create an office table in iqdemo that describes different offices for a fictitious company.
Do one of the following:
In Task view, choose a database from the list of Connected Database, then choose Create a table from the Table Design Tasks.
In Folder view, right-click the Tables folder, point to New, and choose Table.
Name the new table office, and click Next.
Click IQ_SYSTEM_MAIN as the dbspace you want to use to store the new table, and click Next.
In the Comment field, enter: Company
offices
.
Click Finish.
The Table wizard creates the office table, opens the columns tab in the right pane, and prompts you to define the columns. Follow the steps below to add columns to the new office table.
Creating columns for the office table
On the Columns tab, each row represents a single column, and contains all of the attributes for that column.
Use the values in the following table to create the first column. Leave the PKey box checked.
Pkey |
Name |
Data type |
---|---|---|
¸ |
office_id |
integer |
Leave the ID, Size, Scale, Nulls, Unique and Comments attributes blank
To create a new column:
Tab to the end of the current row.
Click the New Column button on the Toolbar.
Click File, point to New, and choose Column.
Use these attributes to create columns for the office table.
Name |
Data type |
Size |
Nulls |
---|---|---|---|
region |
char |
7 |
¸ |
street |
char |
40 |
¸ |
city |
char |
20 |
¸ |
state |
char |
2 |
¸ |
zip |
char |
9 |
¸ |
To save the column definitions:
Click the Save Table button on the Toolbar.
Click File, and choose Save.
The office table is now visible on the tables tab in the right pane of Sybase Central. The office table is now part of the iqdemo database. To add data, click the Data tab, right-click, and choose Add Row, or you can use the Interactive SQL utility. The following section describes how to edit an existing table.