Database Reference
In-Depth Information
such that for a state
st
∈
S
U
,
f(st)
∈
S
U
is obtained from this state by the fol-
m
, and the relation
R
is loaded into the subset of
registers of
S
U
used as a dynamic data memory ('System/data/IO memory' of
M
U
in Fig.
6.2
).
5. The output function
Out
U
satisfies the following properties:
lowing changes:
x
1
=
n,x
2
=
∅
(
empty set
)
if
t
1
(st)
=
1
;
Out
U
(st)
=
(n,
0
,L),
otherwise
,
where
L
is a list of values in
I/O
memory of
M
U
(used for 'INSERT...' and
'UPDATE...'SQLstatementsinthesourceprogram
P
) and
n
is the value of
x
1
.
The output of this function is then transmitted to
M
R
.
Now we can write programs for this machine in order to obtain a synchronic
conversation with the RDB machine
M
R
:
The part of the host program
P
U
in the Load Module of
M
U
for an embedded
SQL statement
g
∈{
COMMIT
,
ROLLBACK
,
{
CALL
n
}
n
≥
1
}
is as follows:
...
prepared triple
(n,
0
,L)
is in its I/O memory
1
,f
1
,i)
f
1
(i
−
sets
x
1
to value
n
≥
1 (program number)
(i,g,i
+
1
)
g
∈{
COMMIT
,
ROLLBACK
,
{
CALL
n
}
n
≥
1
}
(i
+
1
, Out
U
,i
+
2
)
communicates (CALL's) the triple
(n,
0
,L)
to
M
R
to be executed with the program
n
≥
1
2
,f
3
,i
f
3
(i
+
+
3
)
sets the register
x
3
to the value
N
1 (time-counter)
3
,f
3
,i
f
3
(i
+
+
4
)
decrements the time-counter in
x
3
(i
+
4
,t
3
,i
+
k,i
+
5
)
tests the out-of-time response of
M
R
5
, In
∗
EU
,i
takes the resulting data
z
from
M
R
given by
Out
R
(st
(m))
,
where
st
(m)
is the current state of
M
R
(i
+
+
6
)
(i
+
6
,t
1
,i
+
7
,i
+
3
)
tests if
M
R
has responded with the results (
z
=∅
)
(i
+
7
,t
2
,i
+
8
,i
+
m)
tests the error condition of
M
R
(consistency)
(i
+
8
,...,...)
continues with execution without errors
...
(i
+
k,...,...)
continues with out-of-time error condition
...
(i
+
m,...,...)
continues for error database-condition
...
Program 1
Let us define a
categorial
RDB machine
M
R
which has to execute the SQL state-
ments of the original source program
P
, translated by Precompiler and Bind mod-
ules into the Application Plans (
n
-operators, composed of the variable-binding
operators obtained from the operators of the
Σ
RA
algebra in Proposition
20
,
Sect.
5.2
).