Click to See Complete Forum and Search --> : master detail update in form


timgmckee
10-03-2000, 05:08 PM
I have a 5.0 form that is composed of 2 blocks that each point to
a database table. It is your basic master-detail relationship.
I have encountered problems where users are entering
data on the detail table from other forms. This has caused
problems with updates in the master-detail form. I know this
is because the detail row is locked when an update is attempted
on the detail portion of the form. But forms doesn't seem to
correctly handle the answer to the "locked record" popup.
Should I include the FOR UPDATE clause on my detail blocks
where clause to prevent this? What event does the locked record
popup, invoke (not an exception or SQL%NOTFOUND I think)?
Any ideas?

Thanks, Tim

abc
10-04-2000, 11:58 AM
Hi Tim.

Can you explain detail, because i am not getting what is your problem. Like you dont want to see the records which is enter through form.

Thanks
ABC

markgriffin
10-04-2000, 12:08 PM
LOCK_RECORD built-in

Description

Attempts to lock the row in the database that corresponds to the current record. LOCK_RECORD locks the record immediately, regardless of whether the Locking Mode block property is set to Immediate (the default) or Delayed.
When executed from within an On-Lock trigger, LOCK_RECORD initiates default database locking. The following example illustrates this technique.

Syntax

PROCEDURE LOCK_RECORD;
Built-in Type unrestricted procedure
Enter Query Mode no

Parameters

none

This excerpt is from Oracle Forms 5.0 documentation set.

timgmckee
10-04-2000, 01:10 PM
ok, to clarify. How do I tell if the LOCK_RECORD failed to
lock the record.

markgriffin
10-05-2000, 05:14 PM
You will receive Oracle Message "Cannot reserve record..."

Receiving this message is contigent upon you having the row you are trying to modify locked in another form(uncommitted changes ) or db process where records have been modified but no commit has occured.

You could go a step further to trap this message in a form level on-error trigger and display a nice alert message of your own.


Cheers, hope this helps.