reindex 命令示例

在下面的示例中,isexclusive() 函数检验 customer 表是否以独占的方式打开。由于当前工作区中的表并不以独占方式打开,所以不能对该表重建索引。

cexclusive = set('exclusive')
set exclusive off
set path to (sys(2004) + 'samples\data\')
open data testdata && 打开 test 数据库
use customer && 不以独占方式打开
use employee in 0 exclusive && 在另一个工作区中以独占方式打开

if isexclusive( )
reindex && 仅当表以独占方式打开时才能执行
else
wait window 'the table has to be exclusively opened'
endif

set exclusive &cexclusive