Home » Developer & Programmer » Forms » commit in forms- ORA-00001
commit in forms- ORA-00001 [message #80475] Sat, 28 September 2002 03:56 Go to next message
chhan
Messages: 19
Registered: June 2002
Junior Member
Hi All,

i have a form which allows user to select their car registration, make changes to it and then save it to the database.

i have a save button with the following code:

begin
Update tblEnterInto
set DateIn =:tblEnterInto.DateIn,
TimeIn =:tblEnterInto.TimeIn
where EnterInto = tblEnterInto.EnterInto
AND vehicleID = tblEnterInto.VehicleID;
commit;
end;

When i run this the form, i get this error message:

ORA-00001: unique constraint (CC144.PK_ENTERINTO) violated.

how can i update my table thu form without getting this error, i don't want duplicates data in my table, hence the constraint.

any help would be great.

thanks

cc
Re: commit in forms- ORA-00001 [message #80479 is a reply to message #80475] Sun, 29 September 2002 20:57 Go to previous messageGo to next message
sane
Messages: 3
Registered: September 2002
Junior Member
hi,
Your process is simly update maybe you have unique constraint in your fields you attend to update. Check your unique constraint in your table then possibly drop the constraint or disabled it.

I hope i can give u idea.

thanks
sane
Re: commit in forms- ORA-00001 [message #80481 is a reply to message #80479] Mon, 30 September 2002 03:09 Go to previous messageGo to next message
chhan
Messages: 19
Registered: June 2002
Junior Member
I have a primary key and two foreign keys in the table, if i drop the PK constraint, then my table won't be normalise because it would allow duplicate data, which is not something i want in my table.

is there a way of updating my data without creating duplicates?

Thanks

Chhan
Re: commit in forms- ORA-00001 [message #80485 is a reply to message #80475] Mon, 30 September 2002 15:52 Go to previous messageGo to next message
gary
Messages: 35
Registered: January 2001
Member
Since you are using an update statement, you are not using default Forms functionality.
However if your block is a database block, and is in INSERT mode, it is probably trying to insert a record (as part of the commit_form after doing the update), giving your constraint validation.
Re: commit in forms- ORA-00001 [message #80490 is a reply to message #80485] Tue, 01 October 2002 04:03 Go to previous message
chhan
Messages: 19
Registered: June 2002
Junior Member
how do i use the forms functionality to switch off the INSERT mode so that i can update my records.

I have tried changing the datablock properties in DATABASE-> INSERT ALLOWED from YES(DEFAULT) to NO and run the form, i get this message:

YOU CANNOT CREATE THIS RECORDS HERE.

Is there a earier way of saving changes made to records in form?

Many thanks

CC
Previous Topic: calling store procedure in Oracle9i
Next Topic: installation of d2k on linux
Goto Forum:
  


Current Time: Sat Mar 02 09:40:58 CST 2024