How to: Reference: |
A data source stack is a non-persistent (or in-memory) array where you can store and manipulate data from one or more data sources. In the Maintain language, you use data source stacks to hold values you read from the data source and to manipulate data before writing it back to the data source. You can think of a data source stack as a "staging area" in memory in which you can manipulate data before committing it to the data source or displaying it to the end user.
To use a data source stack, first create one using the Stack Editor or editing the procedure as text and typing the appropriate syntax. A stack's columns are usually based on actual data source fields, but you can also add your own columns.
Fill the data source stack with data from one or more data sources. You can then use a form to display the stack data to the user. The user has the option of changing this data; WebFOCUS Maintain stores the changes in the data source stack until the project issues an UPDATE command to update the data source.
There are two ways to create a data source stack:
For more information, see the WebFOCUS Maintain Language Reference manual.
Note: When you use a data source field as a column in a data source stack, WebFOCUS Maintain defines columns based on the rest of the fields in that data source or, if your data source is hierarchical, the rest of the fields in the segment and the key fields in any parent segment. These columns are called implied columns. WebFOCUS Maintain includes all of these fields in your data source stack so that when you update your data source from the data source stack, it knows the path to these fields.
or
Click the New data source stack button on the Maintain Objects toolbar.
Tip: If no data sources appear in the Available fields list, you must specify which ones to use in your procedure. For more information, see How to Specify Data Sources for Your Procedure.
Note: When you copy one of the fields in a segment into the definition of a stack, WebFOCUS Maintain automatically copies all of the rest of the fields in that segment and the key fields from the ancestor segments. These columns are called implied columns.
WebFOCUS Maintain creates an entry for your new data source stack in the Project Explorer under the procedure. When you open it, you see the columns that define the data source stack.
Tip: You can create a data source stack based on the fields in a data source segment by dragging the data source segment to the procedure in which you want to create the data source stack (WebFOCUS Maintain prompts you for the name of the data source stack in the Create New Stack dialog box). Creating a data source stack this way also uses the data source in the procedure if you haven't specified it already.
WebFOCUS Maintain generates Maintain language code for data source stacks. If you wish, you can edit this code directly in the Procedure Editor.
Note: You can obtain help on any Maintain language keyword by selecting the keyword and pressing F1.
When you create or edit a data source stack, WebFOCUS Maintain opens the Stack Editor dialog box.
This dialog box contains the following fields:
Lists the data sources that you have specified for use in this procedure. To define columns for the data source stack, either use existing fields from the data sources or create new ones by clicking New variable.
Copies a selected parameter or field into the list of data source stack columns.
Removes a selected column from the list of data source stack columns.
Contains the columns that you have defined for your data source stack.
When you use a data source field to define a stack, WebFOCUS Maintain defines columns for all of the rest of the fields in the data source. If your data source is hierarchical, WebFOCUS Maintain defines columns for all of the rest of the fields in the segment and the key fields from parent segments. These are the implied columns.
Contains the Maintain language code generated by the Stack Editor dialog box for your data source stack.
When you are creating or editing a data source stack, use the Description tab in the Stack Editor dialog box to enter a description.
You can view the description of a data source stack in the Project Explorer using the Show description command. For more information, see How to View the Description of a Procedure Component.
Use the Create New Stack dialog box to name a data source stack that you have created by dragging a segment from a data source to a procedure.
This dialog box contains the following:
Displays a proposed name for your new data source stack (the name of the segment, followed by Stk. You can accept this name or type a new one of 66 characters or less with no spaces.
WebFOCUS |