Create/Alter/Drop Table Dialog Box

Through the Create/Alter/Drop Table dialog box, SQLWizard provides an interactive means of creating, altering, and dropping tables. In addition to allowing changes to a table's column definition, the Create Table and Alter Table dialog boxes let you add or change an existing table's indexes, primary keys, foreign keys, synonyms, and aliases.

The following describes all fields on the Create/Alter/Drop Table dialog box.

Table Name Specifies a table name using a three-part, two-part, or unqualified table name, as appropriate. If you are altering or dropping a table, you can choose the table name from the Catalog Browser dialog box or the Open Table dialog box when you first access the Alter/Drop Table dialog box.
Comments Describes the table. The comment is stored in the Remarks column in the SYSIBM.SYSTABLES table.
Indexes and Keys Contains a list of the current or pending indexes on the table. You can choose one of the buttons to create, alter, or drop an index or key.
Relationships Contains a list of current foreign keys on this table. You can choose one of the buttons to create, alter, or drop a foreign key.
OK button Accepts all table definition information as shown on the Create/Alter Table dialog box and executes the SQL commands to effect them. On the Drop Table dialog box, the OK button executes the SQL command to drop the table and all its related files and database objects.
Cancel Button Discards all entries or changes that may have been made on the Create/Alter/Drop dialog box.
Options Button Accesses the Table Options dialog box where you can define synonyms and aliases, as well as other important options for your table specification.
SQL Button Opens the Show SQL window to display the pending SQL command(s). Information shown on the Create/Alter/Drop Table dialog box are used by SQLWizard to generate the SQL command(s).
Field (Column) Definitions The grid at the bottom of the Create/Alter/Drop Table dialog box is used to define the columns in your table. Except for the field name, you can either use the default values provided, or change the fields as described below.
Fld. No.
Shows the number of the table row.
Primary Key
The key icon indicates whether the column is part of a primary key. A primary key is used to uniquely identify the rows in a table. Once you have defined a primary key for the table, a key icon appears next to the column.
Field (Column) Name
Identifies each column in a table, view, or result. A column name can be up to 18 characters and must satisfy the rules for a long identifier.
Data Type
Defines the kind or type of data a column may hold. The following lists all available data types:
  • Char
  • Char for bit data
  • Long Varchar
  • Graphic
  • Long Vargraphic
  • Varchar
  • Varchar for bit data
  • Long Varchar for bit data
  • Vargraphic
  • Rowid
  • Time
  • Date
  • Integer
  • Float
  • Float (4)
  • Decimal
  • Money
  • Timestamp
Length
For data types with flexible lengths, type a field length to replace the default field length. If the data type does not have a flexible length, the field length is automatically filled in for you and the field is disabled.
Note: The length shown for some data types is the physical number of bytes used to store the data, rather than a limit on the number of digits or characters in the field. For example, even though the length of a smallint field is shown as 2, a smallint field can contain values between + and - 32767.
Not Null
Allows you to specify whether or not Null values are allowed in the column. Click the down-arrow button to display a drop-down list of options. You may also choose from the list by typing the first character of the option.
False
The column can be null.
True
The column cannot be null. It must contain data.
w/ Default
If the field is null, SQLWizard inserts a default.
Unique
For NOT NULL UNIQUE, used by DB2. If a column is defined as NOT NULL UNIQUE, DB2 allows at most one record to contain a null value.
Comments
Optional. Shows text up to 254 characters for each column in the table. These comments appear in the Catalog Browser dialog box when the Details option is checked.