我正在尝试调试旧的foxpro应用程序,我看到以下查询 -
select db.column1, ..., DELETED() as columnname from ....
我的问题如下 - sql语句中的DELETED()是什么意思?是foxpro函数,还是很可能是代码中出现的自定义函数?
感谢。
答案 0 :(得分:2)
除了Tom Brothers所说的,FoxPro还有一个SET DELETED [ON / OFF]环境设置,用于控制FoxPro命令是否处理标记为删除的记录。此设置的范围限定为数据会话。
* Create a table with 3 records, delete the 2nd record. CREATE TABLE "DeleteTest.DBF" (pk I) INSERT INTO "DeleteTest" (pk) VALUES (1) INSERT INTO "DeleteTest" (pk) VALUES (2) INSERT INTO "DeleteTest" (pk) VALUES (3) DELETE FROM "DeleteTest" WHERE (pk = 2) * Allow VFP to access deleted records, the result will be 3 records. SET DELETED OFF SELECT pk, DELETED() AS delete_flag FROM "DeleteTest" * Prevent VFP from accessing deleted records, the result will be 2 records. SET DELETED ON SELECT pk, DELETED() AS delete_flag FROM "DeleteTest"
答案 1 :(得分:1)
DELETED()是一个foxpro命令,它返回一个逻辑值,指示该行是否已被删除。