Re: FORMS 4.5.10.6.0

From: Margot <mlev_at_NOSPAM.club.tip.nl>
Date: Thu, 17 Jun 1999 18:50:41 GMT
Message-ID: <37693dcc.1219497_at_news.tip.nl>


Instead of:

> Then in an exception:
> If SQLCODE = -54 then -- (-54 is ORA-0054 Resource busy...)
> MESSAGE('Another user is updating this record');
> RAISE FORM_TRIGGER_FAILURE;
> End if;

you can make your own exception like this:

declare

  t_dummy      varchar2(1);
  e_lock       exception;
  pragma       exception_init( e_lock, -54);

  cursor c_lock is
    select ''
    from your_table
    where rowid = :block.rowid
    for update of a_column nowait;
begin

  open  c_lock;
  fetch c_lock into t_dummy;
  close c_lock;

exception
  when e_lock
  then
    message('Another user is updating this record');     raise form_trigger_failure;
end;

Margot

On 17 Jun 1999 16:05:01 GMT, stevec_at_zimmer.csufresno.edu (Steve Cosner) wrote:

>In article <3768E82B.B278B203_at_pride.it>,
>Massimiliano Bellifemine <m.bellifemine_at_pride.it> wrote:
>>I need an information about lock on Developer /2000 1.6.1,
>>the problem is:
>> When two or more users lock the same record for updating,
>> forms displays a warning "COULD NOT RESERVE RECORD (2 TRIES).
>> KEEP TRYING?". I want to convert this message in Italian Language.
>> I did it in this way:
>> trigger ON-LOCK
>> LOCK_RECORD;
>> IF NOT FORM_SUCCESS
>> THEN
>> MESSAGE('Another user is updating
>> this record');
>> RAISE FORM_TRIGGER_FAILURE;
>> END IF;
>> Forms displays these messages "COULD NOT RESERVE RECORD (2 TRIES).KEEP
>>TRYING?" and
>> "Another user is updating this record".
>> How can i resolve this problem?
>
>That message is one you cannot trap. It is automatically generated by
>Forms when the Lock_Record process detects an error. The first thing
>to try is to set up Forms with the correct NLS Language settings so
>the message is displayed in Italian. (I have no experience in this
>area, and I am assuming Oracle has an Italian language version of
>Forms available.)
>
>If no language setting is available, then you can do this: Instead of
>issuing the Forms Lock_Record command, write your own select:
> Select null into xxx from Table_A
> where rowid=:block.rowid for update nowait.
>
>Then in an exception:
> If SQLCODE = -54 then -- (-54 is ORA-0054 Resource busy...)
> MESSAGE('Another user is updating this record');
> RAISE FORM_TRIGGER_FAILURE;
> End if;
>
>HTH
>Steve Cosner
Received on Thu Jun 17 1999 - 20:50:41 CEST

Original text of this message