Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Prevent duplicate data entry

Prevent duplicate data entry

From: <teser3_at_hotmail.com>
Date: Sun, 21 Oct 2007 16:37:49 -0700
Message-ID: <1193009869.171884.198420@e9g2000prf.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US