Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for uniqueness - what's the problem in this code
Message
From
02/05/2002 10:00:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00651801
Message ID:
00651837
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
Possibly, deleted records interfere. In this case, you have to filter the index on "not deleted()".

>Hi everybody,
>
>I have a file with primary index filename+rcode+town+extryear+extrweek.
>
>Before appending records to this file from log file, I run the following code:
>
>set talk on
>set talk window noshow
>
>select LogFile.FileName from (m.lcLogFile) LogFile ;
>         inner join BatchCntrl btch on ;
>      LogFile.FileName+LogFile.rcode+LogFile.Town+LogFile.ExtrYear+LogFile.ExtrWeek = ;
>         btch.FileName + btch.rcode + btch.Town + btch.ExtrYear + btch.ExtrWeek ;
>         group by 1 ;
>         into cursor curCheck
>set talk off
>lnTally = _tally
>if m.lnTally > 0 && It should not happen
>
>* this is a bad case
>endif
>However, periodically we have error message, which is trapped by our Error Handler, that uniqueness of indexes in BatchCntrl table is violated.
>
>I guess, I can change this code to do select from log where in (select from Batch..)
>
>But just out of curiosity, why this code doesn't work as I think, it should?
>
>Thanks in advance.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform