Re: Row level locking: how to do it?
From: <Lance.Humpert_at_mail.tju.edu>
Date: 1996/08/05
Message-ID: <177DAC9BF.ASVLH_at_TJUVM.TJU.EDU>#1/1
> We are trying to solve a problem involving concurrency processing in
> embedded SQL in forms 4.5 trigger. We will greatly appreciate if anyone
> could guide us on how to do row level blocking. The Lock Table command
> doesnot work for row level locking.
Date: 1996/08/05
Message-ID: <177DAC9BF.ASVLH_at_TJUVM.TJU.EDU>#1/1
> Lim Tik Meng (mte_at_moe.ac.sg) wrote:
> We are trying to solve a problem involving concurrency processing in
> embedded SQL in forms 4.5 trigger. We will greatly appreciate if anyone
> could guide us on how to do row level blocking. The Lock Table command
> doesnot work for row level locking.
How are you selecting your rows? Typically in SQL*Forms, some trigger like a 'key-nxtblk' will call the 'execute_query' packaged procedure to read from a base table and select all rows which meet some criteria. If this what you're doing, then you can code your 'execute_query' with a 'for_update' parameter. When the 'for_update' parameter is specified, SQL*Forms attempts to lock all selected records.
Additionally, you might consider specifying the 'nowait' parameter as well. The syntax 'execute_query(for_update, nowait)' will display an error message and allow the user to cancel the query if SQL*Forms can not obtain a lock on a record.
- Lance (I hope this helps, but I'm really not sure that it does!)