Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Prevent duplicate data entry
I would like to make sure there are no duplicate data entries in my
Oracle 9i table (called MainTable) which has an Id field that is the
primary key, ValData with a varchar data type, Fid and Fid2 are number
data types.
Id ValData Fid Fid2
1 abc 34 2 2 efg 23 34 3 zeo 25 43
Sometimes someone can enter a duplicate ValData, Fid and Fid2 and it will end up like this:
Id ValData Fid Fid2
1 abc 34 2 2 efg 23 34 3 zeo 25 43 4 zeo 25 43
What constraints or restrictions can I place on the MainTable where it will never allow a duplicate entry into the table? I would like to do this somehow in the database. If someone tries to enter a duplicate I should get a error message or something to indicate an attempt to enter duplicate data. Received on Sun Oct 21 2007 - 18:37:49 CDT