Creating a Table

 

You can create a new DB2 table against which to run a query.

Fields and controls for the Table Definition page

To create a table:

1.         In the desired connection branch of the DB2 Web Query Tool navigation tree, click Table Data.

A drop-down menu appears.

2.         From the drop-down menu, select New.

The Table Definition page opens.

3.         In the Creator field, type the name of the table creator.

4.         In the Name field, type the name of the table.

5.         In the In-Clause field, type the name of the table space in which you want to create the table.

6.         To add a column to the table, click Add.

DB2 Web Query Tool adds a new column to the table.

Tip:     To delete a column from the table, click the Select button next to the column you want to delete, and click Delete.

7.         Specify the column options:

Name

Specify the name of the column

Type

Specify the type of data which will populate the column, such as integer or decimal.

L,P

Specify the maximum allowable length and precision of the data, where applicable. The length indicates how many integer places the data may have; the precision indicates how many decimal places the data may have. For example, a length and precision specified as 10,2 results in a maximum number of 10 integer places, and 2 decimal places.

Extra

Specify any additional DB2-allowable attributes to add to the column definition, such as Not Null, or a default value.

8.         Click Create.

DB2 Web Query Tool creates a DB2 table using the options you specified, and displays a confirmation message.

You can now select this table and run a query against it.