Programming Guide |
Fetches data from the database for display purposes
int sm_tm_command ("VIEW [tableViewName
[tableViewScope
] ]");
tableViewName
- The name of a server view in the current transaction. This parameter is case sensitive.
If
tableViewName
is specified, the command is applied according to thetableViewScope
parameter. (Since the entire table view tree might not be included, this is known as a partial command, andsm_tm_command
setsTM_FULL
to 0.) The specified table view must either be a server view or be the server view to which the desired table view belongs.If
tableViewName
is not specified, the command is applied for each table/server view, starting with the root table view. This is known as a full command, andsm_tm_command
setsTM_FULL
to 1.tableViewScope
- One of the following parameters, which must be preceded by a table view name.
TV_AND_BELOW
which applies the command to the specified table view and all table views below it on the tree. If no parameter is specified, the transaction manager acts as thoughTV_AND_BELOW
was supplied.
BELOW_TV
which applies the command to the table views below the specified table view.
TV_ONLY
which applies the command to the specified table view only.
SV_ONLY
which applies the command only to the table views of the specified server view.
VIEW
fetches data from the database for display purposes only.When
VIEW
is selected the following steps occur:
- If you have made changes in the table views on which this command operates in a previous
NEW
,COPY
,COPY_FOR_UPDATE
, orSELECT
, you are prompted to discard your changes. If you choose OK, changes are discarded and fields in the specified table views are cleared. If you choose Cancel, you return to the screen so you can save your changes.- The transaction mode is set to view unless a table view is specified. By default, view mode protects all fields from data entry.
- If the Count Select property is set to Yes, the transaction manager issues a
SELECT
statement usingCOUNT(*)
to find the number of rows in the select set. If this number exceeds the amount set in the Count Threshold property, a message box offers the user the choice of discontinuing data selection.- The screen displays the first set of data for all linked table views. When you choose
VIEW
, the common transaction model has the SQL generator execute aSELECT
statement for the database table named in the root table view and any table views connected to it via a server link. Then, recursively,SELECT
statements are issued for the child table views having sequential links, and any table views connected to those child table views by server links. If the query does not return any rows for the first server view, no data are displayed for the remaining server views. (A query which successfully returns rows setsTM_OCC_COUNT
as part of theTM_SEL_CHECK
slice. WhenTM_OCC_COUNT
is greater than 0, the query is generated for the next server view.)Push buttons and menu selections for the
VIEW
command can choose to set the class property toview_button
. By default,view_button
is active in initial or view modes.
If you want to select a specific record or group of records, you need to set the
use_in_where
property toPV_YES
and set the type of operator (where_operator
property) to be used in theWHERE
clause. Then, in the transaction manager, chooseCLEAR
to clear the fields, enter a value in your query field, and then chooseVIEW
. The screen displays the specified information.
If the server view's Count Select and Count Warning properties are set to Yes, the application will warn users about large select sets; however, the
SELECT
statement is performed twice, and the tables must remain locked for the result to be the same for both statements.
To display additional data in two-tier processing, choose any
CONTINUE
command.
The following request events can be generated by the
VIEW
command to ascertain whether the changes from the previous command have been saved and, if desired, discard those changes:
TM_PRE_CLOSE
(described underCLOSE
)
TM_CLOSE
(described underCLOSE
)
TM_QUERY
(described underCLOSE
)
The
VIEW
command generatesTM_CLEAR
requests ifTM_VIEW
for a parent table view returns no data. In that case,TM_CLEAR
is generated for all subordinate table views, but not for table views at the same level of the tree.TM_CLEAR
requests are described underCLEAR
.Table 8-34 Transaction manager command.
If
TM_VIEW
for a parent table view returns no data,TM_CLEAR
requests are generated for all subordinate table views, but not for table views at the same level of the tree.TM_CLEAR
requests are described underCLEAR
.