Transaction involves accessing the database or producing a change in the database. All MQL Statement involve transactions.
Two Types of MQL Transaction
1) Implicit Transaction
2) Explicit Transaction
IMPLICIT TRANSACTION
When ever you enter MQL Statement, the transaction is started and, if the statement is valid, the transaction is committed. Ex-
add person mohan
As soon as you enter the statement, Matrix starts the transaction to define a person named mohan. If that person is already defined, the statement is invalid and the transaction aborts—the statement is not processed and the database remains unchanged. If the person is not already defined, Matrix is committed to (the completion of) the transaction of adding a new person. Once a transaction is committed, the statement is fully processed and it cannot be undone. In this case, mohan would be added to the database.
EXPLICIT TRANSACTION
Some MQL statements enable you to explicitly commit, abort and start transaction.Ex-
abort transaction [NAME];
commit transaction;
print transaction;
start transaction [read];
set transaction wait|nowait|savepoint [NAME];
You can also update the transaction. Ex-
start transaction update;
add businessobject Part “001820” 0
policy Part
description “Part of mobile for xyz model”;
checkin businessobject Part “001820” 0 PB8XCVR;
add businessobject Part ”001821” 0
policy Drawing
description “Substitute Part of 001820”;
checkin businessobject Drawing ”001821” 0 PB8XCVR;
commit transaction;
This transaction is started and the current state of the database is saved. The add businessobject statements create businessobjects, and the checkin businessobject statements add the files. When the commit transaction statement is processed, MQL examines all the statements that it processed since the start transaction. If no error are detected, all changes made by the statements are permanently made to the database. .
Two Types of MQL Transaction
1) Implicit Transaction
2) Explicit Transaction
IMPLICIT TRANSACTION
When ever you enter MQL Statement, the transaction is started and, if the statement is valid, the transaction is committed. Ex-
add person mohan
As soon as you enter the statement, Matrix starts the transaction to define a person named mohan. If that person is already defined, the statement is invalid and the transaction aborts—the statement is not processed and the database remains unchanged. If the person is not already defined, Matrix is committed to (the completion of) the transaction of adding a new person. Once a transaction is committed, the statement is fully processed and it cannot be undone. In this case, mohan would be added to the database.
EXPLICIT TRANSACTION
Some MQL statements enable you to explicitly commit, abort and start transaction.Ex-
abort transaction [NAME];
commit transaction;
print transaction;
start transaction [read];
set transaction wait|nowait|savepoint [NAME];
You can also update the transaction. Ex-
start transaction update;
add businessobject Part “001820” 0
policy Part
description “Part of mobile for xyz model”;
checkin businessobject Part “001820” 0 PB8XCVR;
add businessobject Part ”001821” 0
policy Drawing
description “Substitute Part of 001820”;
checkin businessobject Drawing ”001821” 0 PB8XCVR;
commit transaction;
This transaction is started and the current state of the database is saved. The add businessobject statements create businessobjects, and the checkin businessobject statements add the files. When the commit transaction statement is processed, MQL examines all the statements that it processed since the start transaction. If no error are detected, all changes made by the statements are permanently made to the database. .
No comments:
Post a Comment