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 -> Re: How to determine uniqueness in PL/SQL

Re: How to determine uniqueness in PL/SQL

From: <meetumohan_at_my-dejanews.com>
Date: Thu, 13 May 1999 19:28:21 GMT
Message-ID: <7hf94h$og6$1@nnrp1.deja.com>


In article <7hekr1$27r$1_at_autumn.news.rcn.net>,   "Jerry Gitomer" <jgitomer_at_hbsrx.com> wrote:

I rememberr doing something like this a year back, what you could do is write a cursor on the item you want to check for duplicate values. trigger :
when valid item.
code:
cursor asd is
select item1 from table where
item1 = : item1;

If sql%found then
 .......
else
......

I hope you got the idea.
MM

> Hi Ruiping,
>
> Please clarify your question. The reason I say this is that if
you have
> defined a primary key for a table Oracle will not allow a duplicate to
be
> added. That being the case there is nothing you will have to do in
order to
> prevent duplicates from being added to a table with a primary key.
>
> regards
>
> Jerry Gitomer
> -----------------------------------------------------
>
> Ruiping Gao wrote in message <373A5B87.D6D2A087_at_dpiwe.tas.gov.au>...
> >I have a table which has combination of columns as the table's
primary
> >key. When ever people want to insert records into table, I would like
> >create a trigger to check if it is duplicated records according to
my
> >combination primary key. If it's duplicated records, the system will
> >refuse to accept the records, otherwise the new records can be in.
But I
> >don't know how to do it? Please help.
> >
> >Thanks in advance
> >
> >Ruiping
> >
> >e_mail:ruiping_at_dpiwe.tas.gov.au
> >
> >
>
>

--== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.--- Received on Thu May 13 1999 - 14:28:21 CDT

Original text of this message

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