Copy Column Selection


The Copy Column Selection screen appears when you specified at the Table Copy Selection screen to create temporary selection criteria and enter selection criteria on the template, and also entered in the Column Selection field (see Table-Copy-Selection). It lets you map columns from one table to another.

If you have specified Y in the Column Name Matching field and the column names and data types are identical, they are mapped to the screen in the original order (see the Map field). If column names and data types are not identical, or you specified N in the Column Name Matching field, you must indicate which columns are to be mapped by inserting the appropriate integers in the Map field.

Unmatched column names that are defined as NOT NULL are initialized with a map value of D, meaning that they will be set to the default value for the data type.

To copy from or into distinct type columns both columns must have the same UDT with identical schema, name and built-in data type.

You can execute the SQL primary command on this screen to view or save the SQL File-AID for Db2 generated to complete the task.

Copy Column Selection screen

File-AID for DB2 -------- Copy Column Selection -------- ROW 1 TO 13 OF 14
COMMAND ===>                                      SCROLL ===> PAGE
                                                  SSID: DSN

Use SQL to view/save the SQL source

From Table: USERID.EMP
To Table  : USERID.EMP_NEW

    From Table Columns    Data Type    Map    To Table Columns      Data Type
    -------------------   ---------    ---    -------------------    ---------
 1  EMPNO                 CH(6)         1      EMPNO                 CH(6)
 2  FIRSTNAME             VC(12)        D      FNAME                 VC(12)
 3  MIDINIT               CH(1)         D      MIDDLE                CH(1)
 4  LASTNAME              VC(15)        D      LNAME                 VC(15)
 5  WORKDEPT              CH(3)         D      WORKDEPT              CH(3)
 6  PHONENO               CH(4)         6      PHONENO               CH(4)
 7  HIREDATE              DT            7      HIREDATE              DT
 8  JOB                   CH(8)         8      JOB                   CH(8)
 9  EDLEVEL               SI            9      EDLEVEL               SI
10  SEX                   CH(1)        10      SEX                   CH(1)
11  BIRTHDATE             DT           11      BIRTHDATE             DT
12  SALARY                DC(9,2)      12      SALARY                DC(9,2)
13  BONUS                 DC(9,2)      13      BONUS                 DC(9,2)

F18=EXECUTE

From Table

Name of the table or view to be copied.

To Table

Name of the table or view to which the From Table is being copied.

From Table Columns

Columns to be copied.

Data Type

Data types and lengths of the columns to be copied.

Map

Specify in what order the columns of the From Table are to be mapped. Type in the column numbers of the From Table, or enter D to fill in a default value.

To Table Columns

Names of the columns to which you are copying.

Data Type

Data types and lengths of the columns to which you are copying.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI DevX File-AID for Db2 23.01