Gets an integer attribute of the current transaction#include <tmusubs.h>int sm_tm_inquire(int attribute);
- Specifies the integer attribute of the current transaction to get with one of the constants shown in the Description section.
sm_tm_inquiregets the value of an integer attribute of the current transaction. This includes the data in the current transaction structure itself and data that can be found indirectly—for example, information about the current table view.
Supply one of the following constants to specify the desired transaction attribute:
- Traversal specifier.
- Gets cursor-related behavior that is associated with the transaction event
TM_FINISH. The default setting is 1, which ensures that all cursor-associated locks are released when the
FINISHcommand executes. For behavior that is backward compatible, call
sm_isetand supply a value of 0—
sm_iset(TM_CANCEL_ON_DISCARD, 0). This change affects all outstanding and subsequent transactions for the current database connection.
- Value of
fetch_directionsproperty for current table view:
- Identifies the current transaction event—for example,
CLOSEprocessing of a
- Current transaction mode.
- Current occurrence number of current table view.
- Current request being processed. Use
sm_tm_event_nameto get the string equivalent.
- Error message indicator.
- Full or partial command indicator.
- Indicates whether a transaction model or transaction event function is in use. Values include:
Nothing in use
Transaction model in use
Event function in use
- Link from a table view to its parent table view.
- User specified message code to use for exit condition after a call to
- Occurrence number being processed.
- The number of occurrences in the table view.
- Code reflecting the nature of change, if any, of an occurrence from its before-image.
- Current occurrence of parent of current table view.
- Occurrence that was valid in parent when table view last fetched.
- Indicates the previous transaction manager event. Used when writing an error handler to log the event which generated the error.
- Indicates whether the transaction model or an event function was used in the previous event. Used when writing an error handler. Values include:
Nothing in use
Transaction model used for previous event
Hook function used for previous event
- Return code from
TM_QUERY. Models return:
Return to screen without discarding changes
- When supplied this argument,
sm_tm_inquirereturns the number of rows that the transaction manager asked the transaction model to save to the database.
Note: The value returned by
sm_tm_inquire(TM_SAVE_COUNT)is not equivalent to the number of SQL statements issued, inasmuch as multiple SQL statements can be issued for each row.
If an error occurs during save processing,
sm_tm_inquirereturns 0 and a
DBMS ROLLBACKis executed.
The following example is in
smwizard.jpl:// If new row was added, allow user to work with it.
// Otherwise, place TM back into INITIAL mode.
if (sm_tm_inquire(TM_SAVE_COUNT) > 0)
- Error indicator.
VIEW, this argument is set to 1 if the Count Select property indicates that an initial query be performed to determine the number of rows in the select set.
- Request that gave rise to the current select cursor for the table view (either
- Reserved for user use.
- General purpose integer.
- For the Tuxedo middleware adapter, this argument tests whether the transaction model has started an XA transaction.
sm_tm_iset, sm_tm_pcopy, sm_tm_pinquire, sm_tm_pset