Select List Details Screen [ HP ALLBASE/4GL Developer Reference Manual Vol. 1 ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Reference Manual Vol. 1
Select List Details Screen
This screen allows you to enter the details for an HP ALLBASE/SQL select
list.
Screen Image
Field Descriptions
Select List Enter the name of a select list that has been defined on
the select list header screen.
Select List Details This is a free format text entry area where you can
enter the details of the select list. The entries you make in this field
define the columns of the select list.
Each entry has the format:
field_spec [ = column_definition]
In this expression, field_spec is the name of a dictionary field
specification, and column_definition is a valid HP ALLBASE/SQL
expression. You can use aggregate functions and expressions in the HP
ALLBASE/SQL column definitions. The field specification used to define a
select list column cannot allow multiple occurrences.
The right hand side of this expression is optional. If you don't specify
the right hand side of the expression, HP ALLBASE/4GL uses the field
specification name as the column definition.
Use a comma (,) to separate successive entries. You can enter the
definition of more than one column on a single line on this screen
provided you separate the entries with a comma. Do not use a comma after
the last entry.
Refer to Additional Information for an example of a select list
definition.
Function Keys
f1 Field Specs. Cancels the current screen and displays the
field specifications screen.
f2 SQL Sel Header Cancels the current screen and displays the SQL
select list header screen.
f3 SQL Blk Menu Cancels the current screen and displays the SQL
logic block menu.
f4 Generate List Generates the select list.
Additional Information
A select list is a "virtual" HP ALLBASE/SQL table. A select list
contains columns from one or more base tables or views. Each column is
defined by a dictionary field specification. The values in select list
columns can be:
* Taken directly from a base table column.
* Computed from a base table column value using an arithmetic
expression.
* Computed from the values in various base table columns using an
arithmetic expression.
* Computed from a group of values using an aggregate function (AVG,
MAX, MIN, SUM, and COUNT).
* A constant, or computed from an expression involving constants.
HP ALLBASE/SQL Host Variable References.
Column definitions for an SQL select list can contain references to HP
ALLBASE/4GL file record fields, work area fields, variables and
calculated items, and constants. You cannot use references to
scratch-pad fields or communication area fields in SQL select lists.
SQL select list column definitions can also contain references to screen
fields, provided the reference is a fully qualified reference by name.
You cannot use substrings in references to screen field names.
In a select list you must precede a reference to an HP ALLBASE/4GL item
with a colon (:). That is, you must express the reference in the format:
:data_ref
where data_ref is the HP ALLBASE/4GL name, including the item type prefix
for the HP ALLBASE/4GL item.
Select List Generation.
You must generate a select list before it can be used in the application.
When HP ALLBASE/4GL generates a select list, it uses the field
specifications in the select list column definitions to create a record
layout for the select list.
Select List Example
salesman_no = Salesman_tbl.employee_no,
month = 'Feb',
state = Salesman_tbl.sales_region,
division =Salesman_tbl.sales_division,
tot_sales = SUM(Feb_sales_tbl.amount ),
ytd_quota_pct = 100 * tot_sales / Salesman_tbl.yr_quota
Each entry on the left of the = sign in these expressions is a field
specification that has been defined on the field specifications screen.
MPE/iX 5.0 Documentation