× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 09-Nov-2011 14:15 , Booth Martin wrote:

Here is a flyer: If you call up the record with UPDDTA and then
choose delete instead of update, but don't confirm the delete,
does that by any chance lock the record until you are done?

Not in my experience. I do not even recall any ability of the DFU feature to open nor to share an ODP, using COMMIT(*YES) or not, and irrespective of scoping.

However STRQM, 3=Tables, 10=Change Data will select for update and then in a single-row FETCH will hold an UPDATE lock on the row presented to the display, until exit or F14=Previous row or F15=Next data row. The lock is held irrespective of isolation level. Although if the HLL compilers are not installed, as for the OP, then the ST1 [SQL and QM] product may not be installed either.

Second thought: By any chance, is REXX installed?

REXX is part of the OS, as is the capability to address "*EXECSQL", or to just default to that statement processor via CMDENV(*EXECSQL) on the STRREXPRC. A cursor declared FOR UPDATE and a FETCH of the row should hold the lock.

The following REXX source [referred to as source member LCKTST] should assist to interactively lock for update and hold a row, with selection by RRN, for any file named in the TOFILE() of an OVRDBF request issued just before the STRREXPRC. Scripted:

<code>

/* tell the rexx sql to lock a row in MyFile in MyLib */
ovrdbf LOCKMYROW TOFILE(MyLib/MyFile) OVRSCOPE(*JOB)

/* start rexx sql to lock rrn=3 when run interactively */
strrexprc LCKTST srcfile(qrexsrc) parm(3)

//DATA /* for the member LCKTST of file QREXSRC after: */
/* addpfm qrexsrc LCKTST srctype(REXX) */
/* text('open for update, fetch, wait on wrkjob') */
parse arg RRN
exitRC=0
address "*EXECSQL"
execsql "set option commit=*none, naming=*sys"
if rc<>0 then do; say sqlcode; exit 99; end;
execsql "declare LckRRN cursor for ",
"select rrn(L) from QRECOVERY/LOCKMYROW L ",
"where rrn(L)=" RRN " for update "
if rc<>0 then do; say sqlcode; exit 98; end;
execsql "open LckRRN" ;
if rc<>0 then do; say sqlcode; exitRC=97; call ClsMB; end;
execsql "fetch LckRRN into :LockedRRN" ;
if rc<>0 then do;
if sqlcode<>100 then say "sqlcode:"sqlcode
exitRC=96; call ClsMB
end;
if sqlcode=100 then do;
say "sqlcode:"sqlcode "sqlerr3:"sqlerr3
exitRC=95
end;
address "*COMMAND",
"wrkjob option(*joblck)"
call ClsMB
exit

ClsMB: procedure expose exitRC
execsql "close LckRRN" ;
if sqlcode=-501 then rc=0
if exitRC<>0 then exit exitRC
if rc<>0 then do; say sqlcode; exit 90; end;
address
return

</code>

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.