>>Mike,
>>
>>THe uniqueness error may come from either (1) deleted records or (2) records that are not deleted and actually contain duplicate data
>>
>>(2) cannot be solved, you have to find them
>>
>>(1) can be solved as follows provided the numbers are >= 0
>>
>>
>>alter table TheTable ;
>> add primary key strtran(str(po_no,11,0) + str(po_ln_no,11,0), ' ', '0') for !deleted() tag Id
>>
>
>Hi Gregory,
>
>1) We were carefull to insure against the Deleted records. We got caught a few years ago on that one.
>
>2) There were no other records with an identical
po_no & po_ln_no combination.
>
>Mike
Mike,
If you get an error, then it's (1) and/or (2)
To find out
set deleted Off
select po_no, ;
po_ln_no, ;
cnt(*) ;
from Table ;
group by 1, 2 ;
having cnt(*) > 1
or
set deleted Off
select strtran(str(po_no,11,0) + str(po_ln_no,11,0), ' ', '0') as KeyExpr ;
from Table ;
into cursor tmp
select KeyExpr, ;
cnt(*) ;
from tmp ;
group by 1 ;
having cnt(*) > 1
Gregory