This section tells how to select column names to include in an expression whose results appear in the output of the sample query.
After you select output columns and press <PF4> CONTINUE, CA Dataquery presents the following panel. It is the first of a series of panels that help you set up your own output columns to contain the results of expressions.
=> --------------------------------------------------------------------------DQIA0 DATAQUERY: DEFINE EXPRESSION: SELECT COLUMNS QUERY NAME: SQLGUIDE ------------------------------------------------------------------------------- SELECT ANY COLUMNS YOU WISH TO USE IN CALCULATING THE VALUE OF: EXPRESSION 01. PLACE ANY CHARACTER NEXT TO THE DESIRED COLUMN NAMES. ------------------------------------------------------------------------------- SELECT| TABLE NAME/COLUMN NAME | DESCRIPTION ------------------------------------------------------------------------------- | CAI_SLSHST_TBL | _ | ORD_ID | _ | ORD_QTY | _ | SHIP_QTY | _ | UNIT_PRICE | _ | DISC_PCT | | | | | | | - LAST PAGE ------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> NOT USED <PF4> CONTINUE <PF5> EXTEND COLUMN <PF6> DISPLAY QUERY <PF7> BACKWARD <PF8> FORWARD
Facts
The following presents facts about selecting columns as part of an expression whose results are to be part of the sample query output.
You selected Create your own columns on the GUIDED QUERY CREATION OPTION SELECTION panel.
To create your own data for the report, you must define an arithmetic expression or a literal value. The result is a value that appears on each output row in the output table. The expression is included in the SELECT clause.
Example 1: (SALARY + BONUS) * .10
Example 2: 'RETIRED'
Your query will contain an expression that results in a value that can be handled by CA Dataquery as though it were a value in a column. The expression can contain the names of columns in the table you select, so you get a chance to select those columns.
CA Dataquery offers two panels for each expression needed. On this one, you select column names. To these names, CA Dataquery assigns numbers to represent them in the expression. On the second panel, you write the expression using the numbers to save space. (You also get a chance to do another expression.)
Steps
The following describes the procedure involved in selecting columns for the sample query expression.
Determine what type of result you need to get.
Determine the names of the columns that contain data you want used to create the values of one expression.
Type an X in the fields preceding SHIP_QTY and UNIT_PRICE.
Press <PF4> CONTINUE.
Options
The following lists some other things you can do during this step.
Display a new panel that provides background information about any column selected by positioning the cursor on it and pressing <PF5>.
See how the query looks so far by pressing <PF6>. At this point, no columns or expressions follow the SELECT keyword. The SELECT clause is not complete until all Guided panels relating to it are completed.
Select as many columns as you need to include in an expression.
CA Dataquery displays the panel for writing an expression whether or not you select columns for it.
Additional Information
The following answers some other questions you might have about expressions that create your own columns on report output.
Yes. Any panels listing SELECT columns also list expressions by their names. The first expression you write receives the name EXPRESSION 01, and so on.
The column heading is an automatically assigned expression name (like Expression 01) unless you assign a different name in the report format definition during execution.
|
Copyright © 2014 CA.
All rights reserved.
|
|