Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check for unique field constarint while updating the form

user554531Sep 6 2007 — edited Sep 6 2007
I have to check uniqueness on 2 database fields(x,y)
combination of x, y is unique which should be controlled in front end.


In preupdate and preinsert

iam using sql statement
select count(*) into v_count
from table
where x = 'value'
and y = 'value'

If v_count > 0 then
message('already exists');
raise form trigger failure;
end if

I am trying to update one of the fields in the block .

While committing the form it is giving the message(already exists)from the select query in preupdate.


Is there any way to stop the form other than

on error where error code= 40508 or 40509
then use the above sql stmt.
If count > 0 then
alerting the user(' already exists');
End if;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2007
Added on Sep 6 2007
2 comments
338 views