Progress
Results Administration
and Development Guide
Generating New Queries
You can generate new queries programmatically in Results from a feature or integration procedure. Query generation from a feature or integration procedure uses the
vstbll.p
API procedure and some special Results features.The
vstbll.p
API procedure allows you to set the table list for a new query in Results. You cannot run thevstbll.p
API procedure when there is a current query in Results. If there is an active query in Results, you must execute the AdminProgInitialize feature to clear the query prior to running thevstbll.p
API procedure. Use the following syntax to call thevstbll.p
API procedure from a feature procedure or integration procedure:
The following list describes the parameters associated with the
vstbll.p
API procedure:INPUT tableList
A string value containing a comma-separated list of table or alias names to establish the currently active query in Results. The tables specified must be available in the currently attached databases. If you intend to join a table to another table, you must specify both tables in the list in the order specified in the join. For example, the join Customer OF Order requires that the Customer table must be listed before the Order table in the table list.
OUTPUT result
A logical value that indicates whether the API procedure executed successfully.
To generate queries from a feature or integration procedure, follow these general steps:
- Execute the AdminProgInitialize feature using the
sffire.p
API procedure to clear the current query from Results.- Run the
vstbll.p
API procedure to set the table list for the new query.- Define fields and format information for the new query using the API shared variables and procedures. At a minimum, set the qbf–module and qbf–name variables and define a field for the query.
- Execute the AdminProgInstantiate feature using the
sffire.p
API procedure to initialize any unset API shared variables with valid default values. You must execute this feature before you attempt to display or run the new query.- Save the new query, generate 4GL code for the query, then print it or display it in Results.
The following feature procedure generates a new query, then displays it in Results:
The commented numbers in the code refer to these notes:
- Includes the
u-pvars.i
file to define the API shared variables for access in the procedure.- Defines the input and output parameters required by a feature procedure.
- Defines a variable to capture the output values of the different API procedures used in this feature procedure.
- Executes the AdminProgInitialize feature using the
sffire.p
API procedure to clear the current query from Results.- Sets the table list for the new query. The example feature procedure uses tables from the sports database.
- Defines the join and selection criteria for the tables specified for the new query.
- Defines two fields for the new query.
- Instantiates the rest of the data structures of the new query in preparation for use in Results.
- Sets the output parameter of the feature procedure to TRUE, which tells Results to redraw the window and display the new query defined in the feature procedure.
For more information about the language elements used in the this example procedure, see the Progress Language Reference.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |