Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.
- Complete the steps in the Help topic
To define an SQL call in Online Express, specifying a Union query type. You can also define a Join call within a Union call.
- To define the next SELECT clause, on the Database Access Summary window, click
Database Access >
Continue Union and repeat the steps in the topic
To define an SQL call in Online Express.
- Repeat step
2 for each SELECT clause.
- To ensure that all columns match, click
Database Access
>
Union Cross-Ref The Union Reference window appears, showing the column type and length attributes of each SELECT clause.
- Be sure that the corresponding columns of each statement are identical in type and length. Click
Validate to compare the column type and length attributes for mismatches. Messages identifying the mismatches appear.
- Correct any column mismatches by modifying your column or record selections on the Field Selection or Record Selection dialog
boxes.
- Click
OK.
Note:
- Ensure that the statement with the largest number of columns is the first statement in the list, because Online Express returns
all column data to the host variables of the first SELECT clause. All other statements can be arranged in any order.
- If the last column(s) in the first statement has no corresponding column(s) in the other statements, Online Express automatically
pads the omitted column(s) with an appropriate value—either a blank character, a zero, DATE, TIME, or TIMESTAMP. For example,
Online Express pads the third column of statement 2:
Stmt 1
|
Column 1
|
Column 2
|
Column 3
|
Stmt 2
|
Column 1
|
Column 2
|
|
Stmt 3
|
Column 1
|
Column 2
|
Column 3
|
- If any column in the first statement except the last one has no corresponding column in the remaining statements, pad the
omitted column(s) on the
Field Selection window. This rule applies, for example, to the second column of statement 2:
Stmt 1
|
Column 1
|
Column 2
|
Column 3
|
Stmt 2
|
Column 1
|
|
Column 3
|
Stmt 3
|
Column 1
|
Column 2
|
Column 3
|
- To pad any column, insert a line on the
Field Selection window and enter an asterisk (*) into it. To do so, position your cursor on the desired row, click
Edit >
Create, and type an asterisk as the column name. Online Express pads the column with an appropriate value.