Progress
Results User’s Guide
for UNIX
Determining Files and Selection Criteria
Use the following shared variables in your Progress procedures to determine the files and selection criteria defined when the user selects the User module.
When using these shared variables:
- Results currently supports up to five joins between files in all modules.
- Results sets each unused array entry to contain an empty string (“”) and places it at the end of the array so that no gaps appear in the
qbf-file
andqbf-db
arrays. For example,qbf-file[1] = “customer” qbf-file[2] = “” qbf-file[3] = “order”
cannot process because there is an unused entry (shown as "") between array entries one and three. Instead, the array containsqbf-file[1] = “customer” qbf-file[2] = “order”
, where the unused entry appears at the end of the array.- The WHERE clauses contained in the
qbf-where
variable can be blank or contain the WHERE expression. The value contained within each array element does not begin with the keyword “WHERE.” If theqbf-where
element is blank, it means that there is no WHERE criteria for the corresponding file. (However, there might be a corresponding relation inqbf-of
.)The
qbf-where[ ]
variable might also contain the questions for Ask mode. (These are the prompts users see when they run a WHERE clause that uses Ask mode. They prompt users for a value at runtime.) IfINDEX(qbf-where[],"~{~{")
is greater than 0, then you must do additional processing before you can use the WHERE clause.For example, Results stores the run-time ask information in the WHERE clause between double sets of curly braces ({{ and }}. To use the WHERE clause, everything from {{ to }} inclusive must be replaced with a literal value.
Between these braces, Results stores several fields: the data type (followed by a comma), the field name (followed by a comma), a relational operator (followed by a colon), and the user question. For example,
qbf-where[1]
for the customer file might contain this code:
This means, “Extract all records where the field
sports.customer.St
is equal to a user-supplied character value, and prompt the user with the question Enter state for report. Then place the user-supplied value intoqbf-where[ ]
in the place of
{{character....report}}.- The
OF
clause stores the relation. It begins withOF
orWHERE
, except forqbf-of [1]
, which is usually empty. You can use the following code to combine theqbf-of
andqbf-where
variables:
NOTE: Code similar to this is used in theu-export.p
sample export format program in the "Designing Your Own Export Format" section in this chapter.Use this program listing in conjunction with the
qbf-file
,qbf-where
, andqbf-of
shared variables to produce a Progress 4GL selection statement similar to the following.
This program is important because you use these entry points to determine the files and selection criteria already defined when the User module was selected. Note that when there is a join operation, Results shows all parent relationships, not just the immediate parents.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |