Home » Developer & Programmer » Forms » problem in retrieving record (oracle 10G forms)
problem in retrieving record [message #565673] Thu, 06 September 2012 02:24 Go to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
Hello,

Sir, I have two blocks on which I am having relation based on booking number and employee code. As I am doing a query, booking number is getting fetched in employee code's field and employee code is getting fetched in booking number's feild. Because of this, I am not able to update the form. It is giving me error unable to update record unique contraint voilated for primary key which is quite obivious. But why the data could get shuffled in each others field though during inserting its going properly.
Please help...
Re: problem in retrieving record [message #565674 is a reply to message #565673] Thu, 06 September 2012 02:29 Go to previous messageGo to next message
Littlefoot
Messages: 19294
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How exactly do you perform QUERY operation? Do you enter query mode, enter search criteria, execute query (i.e. you let the Forms engine do the job)? Or do you populate items manually (SELECT ... INTO ...)?
Re: problem in retrieving record [message #565678 is a reply to message #565674] Thu, 06 September 2012 03:48 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
Sir the problem of shuffling the data in diferent items go sorted out. Now during execute query(i.e through form engine) the exact data is getting fetched in respected fields. But still its throwing me an error as unable to update unique contraint violated for primary key.According to my knowledge it is trying to insert the record rather than to update. Why its happening so though I hv given relation on two blocks.
Re: problem in retrieving record [message #565681 is a reply to message #565678] Thu, 06 September 2012 04:05 Go to previous messageGo to next message
Littlefoot
Messages: 19294
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How do you perform updates and inserts? Did you write your own code for that (i.e. INSERT INTO and UPDATE statements)?
Re: problem in retrieving record [message #565683 is a reply to message #565681] Thu, 06 September 2012 04:27 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
I am inserting and updating through form itself.Since I have already maintained relations between two blocks I need not write an update statement. It should get automatically updated as I am saving the form.
Re: problem in retrieving record [message #565685 is a reply to message #565683] Thu, 06 September 2012 04:35 Go to previous messageGo to next message
Littlefoot
Messages: 19294
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That seems to be OK (I was afraid that you might have done it manually).

OK then: there are two blocks (master-detail). Unique constraint is being violated in the detail block, right? If that's so, what is detail block's underlying table's primary key set to? Is it just a single column? If so, no wonder that uniqueness is violated because every new record in the detail block keeps the same primary key value (inherited from the master block). Maybe you should modify the primary key so that it contains additional column(s) or, possibly, distinguish detail table's primary key from its foreign key (which makes a relation between master and detail table).
Re: problem in retrieving record [message #565703 is a reply to message #565685] Thu, 06 September 2012 06:02 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
Sir I'll explain you the entire scenario.
I am working on travel module system in which i have three blocks.
In first block i.e. header block the booking number comes.
In second block i.e. Employee detail block, the names of employees and there details come
and in third block i.e. Travel detail block, the respected travel details come.
In third block, the primary key comprises of three columns i.e. booking number+employee code+travel number.
Now I am maintaining realtions from header block to employee detail by inheriting booking number,
from employee detail to travel detail by inheriting booking number and employee code.
It is thowing me error on third block during modify process wherin it is not allowing me to update travel detail
under given booking number for selected employee.
Re: problem in retrieving record [message #565709 is a reply to message #565703] Thu, 06 September 2012 06:35 Go to previous message
cookiemonster
Messages: 10841
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well you've set something up wrong, but we can't really tell what with the information provided.
When you get the error select 'display error' from the help menu. That'll show what exact statement forms is issuing to get the error.
Previous Topic: Forms 6i Key-help not fired under application
Next Topic: Forms calling mapviewer
Goto Forum:
  


Current Time: Tue Jul 22 23:07:54 CDT 2014

Total time taken to generate the page: 0.11411 seconds