Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Posted on 2006-06-28
Last Modified: 2009-07-29
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
Question by:ayadav1186
LVL 11

Expert Comment

ID: 16999828

Author Comment

ID: 16999884
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.
LVL 16

Expert Comment

ID: 16999904
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.

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

LVL 13

Expert Comment

ID: 17000403
In ON-LOCK block level trigger, code

LVL 16

Expert Comment

ID: 17000457
v$lock and v$locked_object views are available in the database server. Connect as sysdba and do the query.
LVL 27

Accepted Solution

kretzschmar earned 200 total points
ID: 17000881
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 ;-)
LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 200 total points
ID: 17002619
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:
  cursor c_lock is select 1
    from [base table]
    where [key column] = :[block_name].[key_column]
       for update of [any column] nowait;
  dummy number;
  open c1;
  fetch c1 into dummy;
  close c1;
  when others then
     [display a message or alert about the record lock problem]
LVL 27

Expert Comment

ID: 17007250
errm, markgeer is right, my sample is just incomplete

Expert Comment

ID: 20295077
Forced accept.

EE Admin

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question