|
Otros manuales para este modelo:
Resumen del manual
EXEC
SQL
DECLARE
ORDERREVIEW
CURSOR
FOR
SELECT
ORDERNUMBER,
ITEMNUMBER
ORDERQTY,
RECEIVEDQTY
FROM
PURCHDB.ORDERITEMS
WHERE
ORDERNUMBER
>
:ORDERNUMBER
END-EXEC.
The
scop e
and
strength
of
an
y
lo
c
k
obtained
dep ends
in
part
on
the
automatic
lo
c
king
mo
de
of
the
target
table(s).
If
the
lo
c
k
obtained
is
a
shar
e
d
lo
c
k,
as
for
PUBLIC
or
PUBLICREAD
tables,
ALLBASE/SQL
elev
ates
the
lo
c
k
to
an
exclusive
lo
c
k
when
y
ou
up date
or
delete
a
row
in
the
active
set.
The
use
of
lo
c
k
t
yp es,
lo
c
k
granularities,
and
isolation
lev
els
is
discussed
in
the
ALLBASE/SQL
R
efer
enc
e
Manual
.
As
men
tioned
in
the
previous
section,
when
a
transaction
terminates,
an
y
cursors
op ened
during
that
transaction
are
either
automatically
closed,
or
they
remain
op en
if
y
ou
are
using
the
KEEP
CURSOR
option
of
the
OPEN
command.
T
o
a
v
oid
p ossible
confusion,
it
is
go
o d
programming
practice
to
always
use
the
CLOSE
command
to
explicitly
close
an
y
op en
cursors
b efore
ending
a
transaction
with
the
COMMIT
W
ORK
or
R
OLLBA
CK
W
ORK
command.
When
the
transaction
terminates,
an
y
c
hanges
made
to
the
active
set
during
the
transaction
are
either
al
l
c
ommitte
d
or
al
l
r
ol
le
d
b
ack
,
dep ending
on
ho
w
y
ou
terminate
the
transaction.
Using
KEEP
CURSOR
Cursor
op erations
in
an
application
program
let
y
ou
manipulate
data
in
an
active
set
asso
ciated
with
a
SELECT
command.
The
cursor
is
a
p ointer
to
a
row
in
the
active
set.
The
KEEP
CURSOR
option
of
the
OPEN
command
lets
y
ou
maintain
the
cursor
p osition
in
an
active
set
b ey
ond
transaction
b oundaries.
This
means
y
ou
can
scan
and
up date
a
large
table
without
holding
lo
c
ks
for
the
duration
of
the
en
tire
scan.
Y
ou
can
also
design
transactions
that
a
v
oid
holding
an
y
lo
c
ks
around
terminal
reads.
In
general,
use
the
KEEP
CURSOR
option
when
y
ou
wish
to
release
lo
c
ks
p erio
dically
in
long
or
complicated
transactions.
After
y
ou
sp ecify
KEEP
CURSOR
in
an
OPEN
command,
a
COMMIT
W
ORK
do es
not
close
the
cursor,
as
it
normally
do es.
Instead,
COMMIT
W
ORK
releases
all
lo
c
ks
not
asso
ciated
with
the
k
ept
cursor
and
b egins
a
new
transaction
while
maintaining
the
curren
t
(k
ept)
cursor
p osition.
This
makes
it
p ossible
to
up date
tuples
in
a
large
active
set,
releasing
lo
c
ks
as
the
cursor
mov
es
from
page
to
page,
instead
of
requiring
y
ou
to
reop en
and
man
ually
rep osition
the
cursor
b efore
the
next
FETCH.
Lo c
ks
held
on
pages
corresp onding
to
the
curren
t
k
ept
cursor
are
either
held
un
til
after
the
transaction
ends
(the
default)
or
released
dep ending
on
whether
y
ou
sp ecify
WITH
LOCKS
or
WITH
NOLOCKS.
(Pages
held
include
data
and
system
pages.)
Processing
with
Cursors
8-9
...Otros modelos de este manual:
Software - MPE/iX 6.5 Operating System (1.21 mb)
Software - MPE/iX 7.0 Operating System (1.21 mb)
Software - MPE/iX 7.5 Operating System (1.21 mb)