target( ) 函数示例

在下面的示例中,在 order_id 字段上设置从表 orders 到表 customer 的关系,然后用 target( ) 函数返回目标表的别名。

close databases
open database (home( ) + 'samples\data\testdata')
use orders in 0 order order_id
use customer in 0 order cust_id
select orders
set relation to cust_id into customer
? target(1) && 显示“customer”
? target(2) && 显示空串“”