Home » Developer & Programmer » Forms » Error 40501 (Oracle, Oracle Database 11g Express Edition Release 11.2.0.2.0 ,Win 7 Pro)
Error 40501 [message #642281] Sat, 05 September 2015 21:55 Go to next message
shumail
Messages: 149
Registered: September 2012
Location: Canada
Senior Member
Hi All
I was stuck on one issue for several hours and appreciate if someone help you out...

In my form I have 1 data block that contained 2 tables fields, When I take property of this data block and over there I can see 2 tables in query data source name and those names are sage and cases...

In block property I can also see Where condition in which I can see joining between both tables.
Under block property , I can also see another heading that is call advanced database and under this I can see another sub property that is called DML data target name and that contain only 1 table that name is sage table.

In form layout , I have multiple columns and I want to update 1 column from sage table and 1 column from case table but when I try to update any field then I can see the following message :

40501


I also checked my privilege and update those column in database by using SQL developer then I can see update records over there means I don't have any issue related to privilege .

I really appreciate if someone help me out to remove this error

Regards
Shumail

Re: Error 40501 [message #642282 is a reply to message #642281] Sun, 06 September 2015 06:34 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I have no idea what "40501" means. How much would it cost if you specified the message along with the error code?

When the error appears, navigate to form's "Help" menu and choose "Display error". What does it say?
Re: Error 40501 [message #642358 is a reply to message #642282] Tue, 08 September 2015 10:00 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
"FRM-40501 - Unable to reserve record for update"

It sounds like you are joining two tables in your Data Block. You are most likely receiving this error because you do not exclusively identify each column in your block or you do not have the PK columns of the tables included in your block. For example, if you built your block on the HR.EMPLOYEES and HR.DEPARTMENTS tables, your Query Data Source Name property of the block will be: hr.employees, hr.deparments and the WHERE clause property will be: employees.department_id = departments.department_id. Each item displayed in your block must preface the column name with the table name, eg: Column Name property = employees.employee_id, etc. Additionally, you will need to include the PK columns (employee_id and department_id in this example) from both tables in your Data Block. These columns need to be in the block (even if they are not displayed on a canvas) so Forms can lock/reserve the record for update.

If you are not joining the tables in your Block, how is your data block configured?

Craig...

[Updated on: Tue, 08 September 2015 10:01]

Report message to a moderator

Re: Error 40501 [message #642368 is a reply to message #642281] Tue, 08 September 2015 17:43 Go to previous messageGo to next message
shumail
Messages: 149
Registered: September 2012
Location: Canada
Senior Member
Thanks for the reply Craig, will look into this and update you accordingly...
Re: Error 40501 [message #642393 is a reply to message #642368] Wed, 09 September 2015 08:42 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
So...are you basing your data block on a table join? I was simply guessing based on your description...

Re: Error 40501 [message #642401 is a reply to message #642393] Wed, 09 September 2015 11:52 Go to previous messageGo to next message
shumail
Messages: 149
Registered: September 2012
Location: Canada
Senior Member
Hi Craig
I followed all your mentioned steps but no luck. Please find below details.
I have 2 tables, 1 is base and the other one is cse.
In base table, primary key is appear_id
In cse table, primary key is case_id.
Step 1
Create data block manually and configure it like below:
--Query Data Source Name= base,cse
--Where Clause = WHERE base.case_id = cse.case_id
--DML Data Target Name = base,cse
Step 2
Add 1st item base.appear_id in data block and preface the column name with the table name.
Add 2nd item base.lang in data block and preface the column name with the table name.
Add 3rd item cse.case_id in data block and preface the column name with the table name.
Step 3
Run form and go to enter query mode , enter required data and tried to update base.lang field but getting error FRM-40501 : Oracle error: unable to reserve record for update or delete
Please suggest

[Updated on: Wed, 09 September 2015 11:53]

Report message to a moderator

Re: Error 40501 [message #642431 is a reply to message #642401] Thu, 10 September 2015 09:22 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Shumail,
Please take a look at the following Oracle White Paper on using a Table Join as the source for a Data Block (BASING A FORMS DATA BLOCK ON A JOIN).

I don't believe you can use both tables as the DML Data Target, but I have never tried making both tables updatable. It may be that you simply need to specify the PK property on the data block, since this is the most likely reason Forms can't reserve the record and I don't see in your list of steps where you specified the Primary Key property of the data block.

Hope this helps,
Craig...
Re: Error 40501 [message #642490 is a reply to message #642431] Fri, 11 September 2015 18:02 Go to previous message
shumail
Messages: 149
Registered: September 2012
Location: Canada
Senior Member
Thanks for your answer Craig and it looks like that I cannot define 2 DML data sources as you mentioned.
I used your provided link document and solved my issue. Thanks again

Regards
Shumail
Previous Topic: Exception ora-06508: attached libraries : please help
Next Topic: Upgrading old oracle forms
Goto Forum:
  


Current Time: Thu Apr 18 10:17:36 CDT 2024