SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
T-9
TOTAL Command
DDL operation terminates with an error and the operation was partially performed,
the system automatically aborts the user-defined TMF transaction.
DDL statements that operate on nonaudited tables cannot execute when a
user-defined TMF transaction is in progress.
A DML statement access option should provide transaction consistency and
concurrency appropriate for your application and the environment in which it runs.
When your program updates both audited and nonaudited tables in a TMF
transaction, remember that only the audited tables are protected against
inconsistency by TMF.
For example, suppose that a transaction updates two audited tables, A and C, and
an unaudited table, B. Within the transaction, your program updates tables A and
B, detects an error when attempting to update table C, and aborts the transaction.
TMF undoes the changes to table A, but the changes to table B remain, making the
database inconsistent.
TOTAL Command
TOTAL is an SQLCI report writer command that specifies columns in a report for which
to calculate and print totals. TOTAL returns you to the first SELECT output row.
column
identifies a column to total. The column must be a column with a numeric data type
from the current detail line and cannot be an IF/THEN/ELSE column. You can
specify column as a column name, an alias, a detail alias, or COL number (which
specifies the position of the column in the select list).
Considerations—TOTAL
Only one TOTAL command is in effect at a time. When you enter a TOTAL
command, it replaces the previous TOTAL command.
A total prints immediately beneath the print item it totals and uses the same display
format as the print item.
When you specify a print item in a DETAIL command, make sure the display
format in the AS clause allows enough room for the total. If the total is too large for
its display format, the field is filled with overflow characters instead of a total.
To include a date-time value in an AS clause, use JULIANTIMESTAMP to convert
it to a Julian timestamp.
To define a sufficiently large total field for an INTERVAL total (which cannot use an
AS clause), specify a heading wide enough for the largest total value you expect.
TOTAL column [, column ] ... ;