Re: How can I prevent duplicate rows in a table?

From: Fred Miller <millerf_at_merck.com>
Date: 1996/07/31
Message-ID: <31FF8576.28BD_at_merck.com>#1/1


To prevent duplicate rows using an index, you must create a "unique index" on the table.

create unique index <index_name>
on <table_name> (<column1>,<column2>,...) ;

Hope this helps,

-Fred Miller
 Sr. DBA
 Merck & Co., Inc.

Lawrence S Tracey wrote:
>
> I have written a program which runs on an IBM mainframe and inserts
> rows into a table on a server. There appears to be an intermitten bug
> which causes some rows to be dropped. The next problem is when the
> program has to be rerun. I get duplicate rows. I have put an index
> on the table but this does not prevent the insertion of duplicate
> rows. Is there a better way.
> Also, the error messages returned vis SQL*NET are garbage in that I
> get the same message "inconsistent data types" regardless of the error
> on the server.
>
> All help greatly appreciated.

       The contents of this message express only the sender's opinion.
       This message does not necessarily reflect the policy or views of
       my employer, Merck & Co., Inc.  All responsibility for the statements
       made in this Usenet posting resides solely and completely with the
       sender.
Received on Wed Jul 31 1996 - 00:00:00 CEST

Original text of this message