A Transaction - HEIDENHAIN TNC 620 User Manual

Conversational programming nc software 340560-04, 340561-04, 340564-04
Hide thumbs Also See for TNC 620:
Table of Contents

Advertisement

8
Programming: Q Parameters
8.9
Accessing tables with SQL commands

A transaction

In principle, a transaction consists of the following actions:
Address the table (file), select rows and transfer them to the
result set.
Read rows from the result set, change rows or insert new rows.
Conclude transaction: If changes/insertions were made, the
rows from the result set are placed in the table (file).
Other actions are also necessary so that table entries can be edited
in an NC program and to ensure that other changes are not made
to copies of the same table rows at the same time. This results in
the following
transaction
1 A Q parameter is specified for each column to be edited. The Q
parameter is assigned to a column—it is "bound" (SQL BIND...
2 Address the table (file), select rows and transfer them to the
result set. In addition, you define which columns are transferred
to the result set (SQL SELECT...). You can lock the selected
rows. Other processes can then read these rows, but cannot
change the table entries. You should always lock the selected
rows when you are going to make changes (SQL SELECT ...
FOR UPDATE).
3 Read rows from the result set, modify and/or add new rows:
– Adopt one row of the result set into the Q parameters of
your NC program (SQL FETCH...) – Prepare changes in the
Q parameters and transfer to a row in the result set (SQL
UPDATE...) – Prepare new table row in the Q parameters and
transfer as a new row to the result set (SQL INSERT...)
4 Conclude transaction: – If changes/insertions were made, the
data from the result set is placed in the table (file). The data is
now saved in the file. Any locks are canceled, and the result set
is released (SQL COMMIT...). – If table entries were
or inserted (only read access), any locks are canceled and the
result set is released (SQL ROLLBACK... WITHOUT INDEX).
Multiple transactions can be edited at the same time.
You must conclude a transaction, even if it consists
solely of read accesses. Only this guarantees
that changes/insertions are not lost, that locks are
canceled, and that result sets are released.
274
sequence:
not
changed
HEIDENHAIN Conversational Programming | 5/2013
TNC 620 | User's Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents