═══ 1. The Visualizer DB2 Toolkit ═══ This toolkit has been developed by the IBM EAS Product Support to give ease of access to some of the powerful new capabilities in Version 2 of IBM's Database 2 for OS/2 and Database 2 for AIX products. The toolkit provides the following capabilities: o Creation of Tables o Creation and Maintenance of Triggers o Creation of User Defined Types This toolkit should be used in conjunction with Visualizer Query for OS/2, Version 1 Release 2 or later, or with Visualizer Query for AIX Version 1 Release 2 or later. The toolkit can be used with any DB2 Version 2 database, utilising the capabilities of the DB2 Client/Server Family. ═══ 2. Table Creation Capabilities ═══ The Visualizer SQLTable object provides capabilities for the creation and copying of SQL tables within a database. The utility supplied in the toolkit provides the following additional capabilities, to exploit new features of Version 2 of the databases. o Specify Check Constraints o Specify User Defined Data Types o Specify TableSpace options o Rapidly create the same table definition in multiple databases o Name all constraints o Rapidly copy an existing table definition to any DB2 Version 2 database o Save the Create Table SQL as plain text Note: These files are suitable for use as an input file to the DB2 Command Line Processor o Use either an existing table or saved SQL as input for future table creation o Create (and modify) the Data Definition Language for any existing table, including keys, indexes and constraints Examples Create DB2 Table - General ═══ 2.1. Table Creation Examples ═══ The following are ways in which you can use the utility. 1. From an existing DB2 Version 2 table, automatically generate the SQL Create Table statement that would create an identical table, and save it as plain text for use as input to the DB2 command line processor, using the -f parameter. 2. Load the table definition from an existing table, modify it and apply it rapidly to multiple databases, making any changes necessary to accommodate differences in TableSpace structures. 3. Specify all table and column constraints which can be applied. 4. Select a table to be used for a Referential Constraint, and pick, from selection lists, the compatible columns from the table being created to use as a Foreign Key. 5. Specify meaningful names for all constraints which will appear in any error messages resulting from attempts to break the constraint rules. 6. View, Update and Modify an SQL Create Table Statement which was generated by the utility. ═══ 2.2. Create DB2 Table - General ═══ This panel allow general details of a table to be set: The following information must be selected. Database Select the database in which you wish to create the new table from the list of locally catalogued databases. Table Schema Enter the schema in which the table should be created. This will default to the current authorization ID. Unless the current authorization ID has DBADM authority, you should not specify a value here. Table Name Enter the name with which the table should be created. Table Comment Enter up to 254 characters of information which will represent a description of the table. TableSpace Details You may allow the database to choose a default TableSpace. If you choose to specify a TableSpace, you can select a TableSpace from the list box. If the TableSpace you choose is a DMS (Database Managed TableSpace) you can also choose an INDEX TableSpace and a LONG TableSpace. Any indexes created on the table will be located in the INDEX TableSpace, while VARCHAR, LONG VARCHAR and LOB data will be located in the LONG TableSpace. If not specified, INDEX and LONG data are stored in the first TableSpace specified. Data Capture You should only select DATA CAPTURE CHANGES if you wish to store details of changes to the table for use with a data propagator. Panel Pushbuttons Create DB2 Table - Column Details Create DB2 Table - Constraints ═══ 2.3. Create DB2 Table - Column Details ═══ At least one column definition must be entered before a table can be created. If you are modelling the new table on an existing table, or you have previously entered column details, the list box will be populated with the details of existing columns. You can select an existing column as the basis of your new column definition. When you have entered the complete column definition, you can select MODIFY, which will modify the selected column definition, or ADD to add a new column. Column Name Enter the column name. Column names are case sensitive, and will be passed to DB2 exactly as typed. Position Choose the relative position for the column in the table. Note that when a new name is entered in the column name field, the position will be updated automatically to one greater than the number of columns already defined. When Add or Modify is selected, the existing columns will be rearranged if necessary to accomodate the column. Type Schema Select the appropriate schema for the data type to be used for the column. Built in data types are in the SYSIBM schema. User defined distinct types may exist in other schemas. Type Name All types in the selected schema will be displayed. Select the required type. Length A length can only be entered for data types where length is supported. For LOBs, only enter the numeric portion of the length. Scale For decimal columns, scale specifies the number of decimal places. For LOBs, specify one of K Kilobytes M Megabytes G Gigabytes Treatment of Nulls A column can be specified to accept null values or reject null values. With Default When this option is specified, any null data inserted into the column will be replaced with a default for the datatype. (either spaces or zero). For Bit Data This may only be set for character columns, and ensures that no code page translation is performed on the column. This ensures that the bit values of the column remains unchanged. Compact This option is only available for large objects. Although use of this option saves on disk space, it reduces the possibility of applications being able to search the LOBs for matches. No Logging DB2 logs updates made to tables. However, with large objects this can be impracticable or impossible. The maximum size of a DB2 log file is 1 Gigabyte. No LOB of this size or larger can be logged. Logging of large LOBS can consume vast amounts of disk space and fill DB2 logs. Column Remarks Enter up to 255 characters of remarks Panel Pushbuttons Create DB2 Table - General Create DB2 Table - Constraints ═══ 2.4. Create DB2 Table - Constraints ═══ This panel is divided into 4 sections 1. Primary Key The primary key section contains the following elements: Constraint Name You can supply a name for the primary key constraint, or allow it to default. There is little value in supplying a name for a Primary Key constraint. Available Columns Select, in order of precedence, the columns to be included in the primary key, and press the Add> button. Use the