[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 10867
  • Last Modified:

FRM-40501: ORACLE error: unable to reserve record for update or delete

Hi Guys,
I have form that takes view (created from several tables) once loaded,  I tried to press any editing key,
It throws error below

FRM-40501: ORACLE error: unable to reserve record for update or delete

Please let me know what I am doing wrong?
Thank you
Anil.
0
ayadav1186
Asked:
ayadav1186
2 Solutions
 
mohammadzahidCommented:
0
 
ayadav1186Author Commented:
Lot many workarounds but does not work for me. One thing I noticed is Forms tries to lock row by adding rowid in front of view columns. Is there any way to prevent Forms from doing so?
I am able to update view in SQL*Plus wihout any issues.


Thanks for response.
0
 
MohanKNairCommented:
As the above link suggests, is there any other user using the same view or table? Query v$lock and v$locked_object views.
v$locked_object tells about the table names that are locked.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
riazpkCommented:
In ON-LOCK block level trigger, code

NULL;
0
 
MohanKNairCommented:
v$lock and v$locked_object views are available in the database server. Connect as sysdba and do the query.
0
 
kretzschmarCommented:
riazpk is right

of course if there is no instead of trigger is attached on your view,
you may not able to save your changes, except you use the
ON-UPDATE/ON-INSERT/ON-DELETE trigger on block-level
to update the physical tables of the view

instead of placing NULL in the ON-LOCK trigger in case of
you want to lock, you can place there also

SELECT * FROM physicalTable WHERE key = :blockkey FOR UPDATE;
--repeat for every table in the view

meikl ;-)
0
 
Mark GeerlingsDatabase AdministratorCommented:
I agree with kretzschmar, you need to write an ON-LOCK trigger manually for a block that is based on a join view, but I think his syntax example is incomplete.  I think the trigger syntax you need is more like this:
declare
  cursor c_lock is select 1
    from [base table]
    where [key column] = :[block_name].[key_column]
       for update of [any column] nowait;
  dummy number;
begin
  open c1;
  fetch c1 into dummy;
  close c1;
exception
  when others then
     [display a message or alert about the record lock problem]
end;
0
 
kretzschmarCommented:
errm, markgeer is right, my sample is just incomplete
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now