Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update table problem 2

Status
Not open for further replies.

scomfort

Programmer
Dec 3, 2003
44
GB
Hi there,

I'm having a problem updating a table in Oracle Forms 9i....
The user searches for a match in table A (consists of a sequential primary key and 4 other data fields) and if a match is found the results come up; they then choose one of the data fields by way of a radio button changing its value from y to n. However when it comes to committing it will not allow this and an error message saying cannot insert record pops up...looking at the error says unique constraint violated for the primary key. So its as if its trying to create a new set of data with the same primary key but the differing value for whatever the user chose. All I want is for it to update the data field in the already existing primary key.
Just to make sure the primary key was working ok I displayed it on-screen and it comes up fine. Just seems to want to insert rather then update! However I will need to insert too in case there is no match when the user performs the search. In this case a new primary key is generated with its respective data fields filled in. This inserts and commits fine, since there is no matching primary key. Its when it comes to updating an existing table that I encounter a problem.
Any ideas?
Thanks.
 
Thanks a lot for the help Sem and BJCooperIT - managed to get it to work at last :)
Wouldnt have been able to do it without your help so cheers again.
 
Progress is a wonderful thing!

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top