Creating a Table

Restriction: This topic applies to Windows environments only.

You can use SQLWizard to create and manage your database tables. You can define indexes, primary keys, foreign keys, synonyms, and aliases using buttons available from the Create Table dialog box.

To create a table:

  1. Click the Create command from the Table menu.
    Note:


    Catalog Browser button
    From the Catalog Browser dialog box, click the Table tab; then click the Create button.

    SQLWizard displays the Create Table dialog box.

  2. Type a name in the Table Name field. You can enter a one, two, or three-part name.
    Note:

    If you create a table in a different location than your current location, SQLWizard performs a connect to that location and then resets the location after the create is complete.

  3. Position the cursor in the Column Definition Grid in the lower half of the dialog box. Start in Field Name of Fld No. 1 and type a name for the first column of your table.

    You must define at least one column in the table when you create it. You can alter the table later to add, delete, or move columns.

  4. Position the cursor in the Data Type field to display a down-arrow button. Click the down-arrow button to display a drop-down list of data types. (This button does not become visible until the cursor is positioned in the Data Type field.) Choose a data type from the list.

    Alternatively, you can type a data type without displaying the list. Usually, the first letter you type is enough; SQLWizard completes the entry.

  5. Provide Length and Not Null information, or accept the defaults.
  6. Add, delete, or move rows as desired.

    Add rows to the table by clicking on the + button, while the cursor is inside the Column Definition Grid. The + button adds a row immediately after the row of the cursor's position. (Alternatively, press the keyboard down arrow cursor key to move the screen cursor down to a new row.)

    Delete a row by clicking on a number under the Fld. No. column to select a row. Click the - button to delete the selected field number from the list. You can select any number of rows to be deleted at one time.

    Move a column definition up or down in the list by selecting the row to move and clicking on its field number under the Fld No. column. Click the up or down arrow buttons to move the fields up or down the list, one row at a time. You can move more than one row at a time if you highlight contiguous rows by clicking on the field-number button on the left.

  7. If your table requires the specification of options relating to compatibility with DB2 or another supported database, click the Options button to display the Table Options dialog box. When you have finished specifying table options, click OK to return to the Create Table dialog box.
  8. Click OK to create the table.