HP 3000 Manuals

Relation Conditions [ HP ALLBASE/BRW Reference Manual ] MPE/iX 5.0 Documentation


HP ALLBASE/BRW Reference Manual

Relation Conditions 

Relation conditions restrict the records written to the result table to
those that match a specific condition.  Relation conditions are
independent of relations.  That is, you do not need to define a relation
in order use a relation condition.

Relation Conditions have these characteristics 

   *   They select a subset of records to be included in a table.

   *   They are calculated from items, calculated items, or functions
       defined in the same table, parameters or constants.

   *   They must be logical-exprs, according to Syntax Diagram 2, in
       Chapter 15 .

   *   They are expressed with the calculation language as described in
       Chapter 15 .

To define a relation condition 

   1.  At the Define Report screen, Define Relation screen, or the
       Project Items screen, choose Relation Condit'n.

   2.  Type the condition formula, using the calculation language
       described in Chapter 15 .

[]
3. Press Enter. If you made a mistake, the part of the formula that is in error is highlighted. Correct the error and press Enter again. You can also press Exit Save to save the formula in spite of the error. This lets you return to some other part of HP ALLBASE/BRW to verify item names or other formula elements and then return to the Relation Condition screen to correct the formula later. For more details on how to use the Relation Condition screen, see the Relation Condition section of Chapter 16 . Examples The condition shown below selects only those orders with order numbers that begin with ZJ: SUBSTRING (ORDER-NO,1 ,2) ="ZJ" The next condition selects only those invoices that are overdue: DUE-DATE < DATE This condition selects shipment dates in the month equal to the parameter value provided at run time for ?month: MONTH_OF (shipment-date) = ?month When you define a relation condition and a relation, the relation condition further refines the data selection. For example, suppose you defined a new table (CUST-INVOICES) from the CUSTOMER table and INVOICES table with a relation between the CUSTOMER-NOs for each table. If you also defined the relation condition DUE-DATE < DATE, only those records whose CUSTOMER-NOs matched records in each table and whose invoices were overdue would be written to table CUST-INVOICES.


MPE/iX 5.0 Documentation