Locking in PH
Lorry Litman
LLitman@exchange.hsc.mb.ca
Tue, 19 Dec 2000 09:57:36 -0600
Good morning,
if it's simply a locking issue change 'LOCK INVOICE_CNT' to 'LOCK
INVOINCE_CNT FILE'
I do a similar seq-no-generation, however, I use a SEQUENTIAL file and I
don't specify any 'OPEN CLOSE' on my file statement.
Thanx
Lorry
-----Original Message-----
From: kevinwong [mailto:kevinwong@hk.ublaze.com]
Sent: Tuesday, December 19, 2000 10:58 AM
To: powerh-l@sphere.swau.edu
Subject:
Dear all,
I store my next invoice number in a one-record direct file which will be
updated as the user create new invoice.(seq. no. generation.)But I find out
that the file was never locked when dup-record error was reported from
user.
I never expect simple function like seq.-no.-generation will go wrong, is it
the problem of choosing file type (Direct organ.)?
Thanks in advance for you help
Kevin Wong
System info :-
Ph Ver. : 710g1
Platform : Alpha OpenVMS 7.1 / RMS
P.S. Quick program and Dictionary defination are as follows
screen exe:sp300
temp parameter char*20 init ""
file invoice
file invoice_cnt designer open close
.
.
.
proc preupdate
begin
if newrecord
then begin
lock invoice_cnt
get invoice_cnt seq
let invoice_no = asc(ncon(invoice_cnt) + 1,6)
let invoice_cnt = invoice_no
put invoice_cnt
unlock invoice_cnt
disp invoice_no
info = "New invoice " + asc(ncon(invoice_no)) + &
" has been created." now response
end
end
Dictionary :-
R E C O R D R E P O R T
For DICTIONARY: DRA0:[SP2000.DIC]PHD.PHD;
Record: invoice_CNT
of File: invoice_CNT
Organization: DIRECT
Type: RMS
Open: DAT:invoice_CNT
Record Format: Fixed
Supersede: No
Record Size: 6 Bytes
-- Record Contents --
Item Type Size Occ Offset
invoice_CNT CHARACTER 6
0
______________________________________________________________________
Get Your 100Mb, Free Web-based E-mail from uBlaze.com at
http://mail.ublaze.com
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.