Locking Table [message #64844] |
Wed, 18 February 2004 20:42 |
Qavi
Messages: 24 Registered: August 2002
|
Junior Member |
|
|
Hello,
i have a talbe for Generating document number in incremental manner by 1, i have a document type INV which is invoked by multiple users to issue invoices, this is getting locked and users have to hangup till it gets unlocked , my procedure is this
PROCEDURE invoice IS
docno number;
showalert number;
cursor gal_inv is select brd_no+1 from abs.t_documents for update of brd_no nowait;
begin
fetch gal_inv into docno;
if :cust_acno2 is null then
update abs.t_documents set brd_no = docno ;
:invno1 := docno;
else
update abs.t_documents set brd_no = (docno+1) ;
:invno1 := docno;
:invno2 := docno+1;
end if;
commit;
close gal_inv;
end if;
end;
users have to wait for atleast 2 mins till the transaction gets commited and table gets released .
its urgent please
thx in advance
Qavi
|
|
|
|