Hi nadya,
I don't quite understand what you're doing here, but I guess it could be concurrency (multiuser) problems.
The select statement uses OS level buffered data when it can. It does not ensure that it uses the most recent data on the network.
Before checking for uniqueness, the involved table must be (file)locked in order to get the most recent data from it.
Walter,
>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
>
>* 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.