Home » SQL & PL/SQL » SQL & PL/SQL » help for using update query
help for using update query [message #216952] Wed, 31 January 2007 00:54 Go to next message
ramyashree.rp
Messages: 9
Registered: January 2007
Junior Member
cursor update_for
is
select AER_ID,SEQ_AE_CHAR,DATA_LEVEL,OUTCOME,OUTCOME_COMPANY from AER_AE_CHAR where AER_ID=id and DATA_LEVEL=1 for update of
OUTCOME,OUTCOME_COMPANY;



if(flag) then
update AER_AE_CHAR set OUTCOME=temp, OUTCOME_COMPANY=temp1 where current of update_for;

else
insert into AER_AE_CHAR(AER_ID,SEQ_AE_CHAR,DATA_LEVEL,OUTCOME,OUTCOME_COMPANY) values(id,i+1,1,temp,temp1);
end if;


this statement is giving error for me.

the error is:
ERROR at line 1:
ORA-00001: unique constraint (AG50226.PK_AER_AE_CHAR) violated
ORA-06512: at "AG50226.P_SET_OUTCOME", line 60
ORA-06512: at line 1



can anybody tell the solution plz. i tried a lot.
Re: help for using update query [message #216956 is a reply to message #216952] Wed, 31 January 2007 01:01 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Read the errormessage. It says you violate a unique constraint.
On your AER_AE_CHAR table you have a unique constraint, but you try to update or insert a row, such that you create a duplicate value.
Check what the constraint looks like (which columns are involved) and then check your code.
Re: help for using update query [message #216957 is a reply to message #216952] Wed, 31 January 2007 01:12 Go to previous message
ramyashree.rp
Messages: 9
Registered: January 2007
Junior Member
Hi,
thanks for the reply. in my table AER_ID and SEQ_AE_CHAR are the unique constraints. but when i was not using the update statement the procedure was working fine. but after using the update satement its giving error like this.
Previous Topic: problem with trigger.
Next Topic: Materialzied View on Fast Refresh
Goto Forum:
  


Current Time: Fri Dec 09 19:44:23 CST 2016

Total time taken to generate the page: 0.07879 seconds