Opening Results in a New DB2 Table

 

DB2 Web Query allows you to export your query results to a DB2 table, so you can work with your results in your DB2 database. You can create a new DB2 table containing your query results, or you can add your query results to an existing DB2 table.

To open results in a new DB2 table:

1.         In the desired connection branch of the DB2 Web Query navigation tree, click Results.

The Results branch expands, listing Recent and Saved results sets.

2.         Select the results set you want to open.

A drop-down menu appears.

3.         From the drop-down menu, select Open.

The Select Output page appears.

4.         Select DB2 Table, and click Next.

The Tables page appears.

5.         From the list of existing tables, select New Table, and click Next.

The Table Definition page appears, and displays a default table configuration based on the columns and rows of the results set you specified.

Tip:     Click Sample Data to display rows from the results set you are exporting in the Sample Data Viewer, so you can select the appropriate column options.

6.         In the Creator field, enter the name of the table creator.

7.         In the Name field, enter the name of the table.

8.         In the Commit Scope field, enter the commit scope.

Tip:     The commit scope is the number of actions that are performed on the table before the changes are committed to the database. For example, if you enter a commit scope of 50, after 50 actions are performed on the table, all changes are committed to the database.

9.         In the In-Clause field, enter the name of the tablespace in which you want to create the table.

10.      To add a column to the table, click Add Column. To delete a column from the table, click the Select button next to the column you want to delete, and click Delete Column.

11.      Specify the table column options:

Name

Specify the name of the column. By default, the column names match the results set column names.

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 in the column, 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.

From

Match the column in the results set to the column in the new table. By default, the columns in the results set are matched to the columns of the same name in the new table.

12.      Click Next.

DB2 Web Query creates the new table containing the results set you specified, using the options you specified, and displays a confirmation message.