Group,
Is there any way to get around a trigger when trying to remove a duplicate
record? I get 'trigger failed' , of course. Would I have to delete the
procedures (i.e modify procedures) and redo them after the delete?
Wade

Re: Trigger problem by Christof

Christof
Mon Jul 21 04:00:26 CDT 2008

Hi Wade,

If you have two records that are now invalid and will fire the delete
trigger, you could first change one of them, for example, replace the
primary key.

If the question is how you can re-use a key once you deleted a record with
the same key, then the answer would be to use an index with a FOR NOT
DELETED() clause as the primary key. Of course, the question would be, why
you have repeating primary keys, at all.

--
Christof



Re: Trigger problem by W

W
Mon Jul 21 06:15:50 CDT 2008

Thanks Christof,
What I do now is create a cursor with the duplicates, index on it unique,
index on the table unique, set relation from the cursor to the table, and
scan the cursor, deleting dups from the table. It seems to work o.k., but
seems to be a kludge.
Wade

"Christof Wollenhaupt" <msnews.microsoft.com.20050422@prolib.de> wrote in
message news:u3yfvAx6IHA.5012@TK2MSFTNGP02.phx.gbl...
> Hi Wade,
>
> If you have two records that are now invalid and will fire the delete
> trigger, you could first change one of them, for example, replace the
> primary key.
>
> If the question is how you can re-use a key once you deleted a record with
> the same key, then the answer would be to use an index with a FOR NOT
> DELETED() clause as the primary key. Of course, the question would be, why
> you have repeating primary keys, at all.
>
> --
> Christof
>
>
>



Re: Trigger problem by ED

ED
Wed Jul 30 03:02:35 CDT 2008

My 2c,

Quicker way would be to:
no index set
delete all
set index to unique tag
set deleted off
recall all
pack if necessary

No need to scan and compare.

ED

"W.Davis" <wdavis3@cinci.rr.comNOSPAM> wrote in message
news:%23x3ejMy6IHA.4292@TK2MSFTNGP02.phx.gbl...
Thanks Christof,
What I do now is create a cursor with the duplicates, index on it unique,
index on the table unique, set relation from the cursor to the table, and
scan the cursor, deleting dups from the table. It seems to work o.k., but
seems to be a kludge.
Wade

"Christof Wollenhaupt" <msnews.microsoft.com.20050422@prolib.de> wrote in
message news:u3yfvAx6IHA.5012@TK2MSFTNGP02.phx.gbl...
> Hi Wade,
>
> If you have two records that are now invalid and will fire the delete
> trigger, you could first change one of them, for example, replace the
> primary key.
>
> If the question is how you can re-use a key once you deleted a record with
> the same key, then the answer would be to use an index with a FOR NOT
> DELETED() clause as the primary key. Of course, the question would be, why
> you have repeating primary keys, at all.
>
> --
> Christof
>
>
>



Re: Trigger problem by W

W
Wed Jul 30 08:40:16 CDT 2008

Thanks ED,
I knew the way I did it was a 'kludge'. I like the simplicity of your
suggestion.
Wade


"ED" <nospam@thankyou.com> wrote in message
news:eu1Ynqh8IHA.3656@TK2MSFTNGP04.phx.gbl...
> My 2c,
>
> Quicker way would be to:
> no index set
> delete all
> set index to unique tag
> set deleted off
> recall all
> pack if necessary
>
> No need to scan and compare.
>
> ED
>
> "W.Davis" <wdavis3@cinci.rr.comNOSPAM> wrote in message
> news:%23x3ejMy6IHA.4292@TK2MSFTNGP02.phx.gbl...
> Thanks Christof,
> What I do now is create a cursor with the duplicates, index on it unique,
> index on the table unique, set relation from the cursor to the table, and
> scan the cursor, deleting dups from the table. It seems to work o.k., but
> seems to be a kludge.
> Wade
>
> "Christof Wollenhaupt" <msnews.microsoft.com.20050422@prolib.de> wrote in
> message news:u3yfvAx6IHA.5012@TK2MSFTNGP02.phx.gbl...
> > Hi Wade,
> >
> > If you have two records that are now invalid and will fire the delete
> > trigger, you could first change one of them, for example, replace the
> > primary key.
> >
> > If the question is how you can re-use a key once you deleted a record
with
> > the same key, then the answer would be to use an index with a FOR NOT
> > DELETED() clause as the primary key. Of course, the question would be,
why
> > you have repeating primary keys, at all.
> >
> > --
> > Christof
> >
> >
> >
>
>



Re: Trigger problem by ED

ED
Thu Jul 31 01:40:21 CDT 2008

You're welcome. Glad you checked back on the thread...
ED

"W. Davis" <foxteeth@zoomtown.com> wrote in message
news:%23JUoSnk8IHA.1192@TK2MSFTNGP05.phx.gbl...
Thanks ED,
I knew the way I did it was a 'kludge'. I like the simplicity of your
suggestion.
Wade


"ED" <nospam@thankyou.com> wrote in message
news:eu1Ynqh8IHA.3656@TK2MSFTNGP04.phx.gbl...
> My 2c,
>
> Quicker way would be to:
> no index set
> delete all
> set index to unique tag
> set deleted off
> recall all
> pack if necessary
>
> No need to scan and compare.
>
> ED
>
> "W.Davis" <wdavis3@cinci.rr.comNOSPAM> wrote in message
> news:%23x3ejMy6IHA.4292@TK2MSFTNGP02.phx.gbl...
> Thanks Christof,
> What I do now is create a cursor with the duplicates, index on it unique,
> index on the table unique, set relation from the cursor to the table, and
> scan the cursor, deleting dups from the table. It seems to work o.k., but
> seems to be a kludge.
> Wade
>
> "Christof Wollenhaupt" <msnews.microsoft.com.20050422@prolib.de> wrote in
> message news:u3yfvAx6IHA.5012@TK2MSFTNGP02.phx.gbl...
> > Hi Wade,
> >
> > If you have two records that are now invalid and will fire the delete
> > trigger, you could first change one of them, for example, replace the
> > primary key.
> >
> > If the question is how you can re-use a key once you deleted a record
with
> > the same key, then the answer would be to use an index with a FOR NOT
> > DELETED() clause as the primary key. Of course, the question would be,
why
> > you have repeating primary keys, at all.
> >
> > --
> > Christof
> >
> >
> >
>
>