General rules
Types and functions of the control SQL
The control SQL connects a UAP to HiRDB, disconnects a UAP from HiRDB, and performs lock control on tables.
Table 5-1 shows the types and functions of the control SQL.
Table 5-1 Types and functions of the control SQL
Type | Function |
---|---|
COMMIT statement (Terminate transaction normally) | Terminates the current transaction normally, sets synchronization points, generates one unit of commitment, and puts into effect the databases updates performed by the transaction. |
CONNECT statement (Connect UAP to HiRDB) | Passes the authorization identifier and password to HiRDB, enabling the UAP to use HiRDB. |
DISCONNECT statement (Disconnect UAP from HiRDB) | Terminates the current transaction normally, sets synchronization points, generates one unit of commitment, and disconnects the UAP from HiRDB. |
LOCK statement (Lock control on tables) | Performs exclusive lock on specified tables. |
CONNECT statement with RD-node specification (Connect to distributed RD-node) | Passes an authorization identifier and password to a distributed RD-node so that the UAP may use that distributed RD-node. |
DISCONNECT statement with RD-node specification (Disconnect from distributed RD-node) | Terminates the current transaction normally, establishes a synchronization point, and creates a single commitment unit. The UAP is then disconnected from the distributed RD-node. |
ROLLBACK statement (Cancel transaction) | Cancels the current transaction and nullifies the database updating performed by the transaction. |
SET CONNECTION statement (Set current RD-node) | Sets the current RD-node. |
SET SESSION AUTHORIZATION statement (Change connected user) | Changes a connected user by reporting an authorization identifier and password to HiRDB. |
Notes on specifying the control SQL
The transaction is the unit of logical work; it is the basic unit by which HiRDB recovers data and performs concurrent execution of UAPs. To improve the system's concurrent execution capability, the amount of time required by a transaction should be as short as possible. Especially when large quantities of data are updated, the duration of lock control, the number of resources subject to lock control, and the amount of log data generated must be taken into consideration. In some cases, it may be necessary to divide a transaction into several subunits.
Notes on X/open-compliant UAPs running under OLTP
The following SQL statements cannot be used in X/Open-compliant UAPs running under OLTP: