如何基于动态查询删除表中的记录? [英] How can I delete a record in a table, based on dynamic queries?
本文介绍了如何基于动态查询删除表中的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这个问题是这个.
我目前有以下源代码:
CREATE BUFFER h-Table1 FOR TABLE "Table1" NO-ERROR.
IF VALID-HANDLE(h-Table1)
THEN DO:
L-Found = h-Table1:FIND-FIRST("WHERE ...
IF L-Found
THEN h-Table1:BUFFER-DELETE().
当我启动 BUFFER-DELETE()
命令时,出现错误 335(Table1 记录具有 NO-LOCK 状态.不允许删除.(335)
).我需要如何更改我的源代码才能使其正常工作?(如何更改 Table1 记录的状态?)
When I launch the BUFFER-DELETE()
command, I have error 335 (The Table1 record has NO-LOCK status. DELETE not allowed. (335)
). How do I need to alter my source code in order to make this work? (How can I alter the status of my Table1 record?)
提前致谢
推荐答案
h-Table1:FIND-FIRST ("WHERE ....", EXCLUSIVE-LOCK) .
或在第一次查找之后(应该使用明确的 NO-LOCK 选项完成)
or after the first find (which should have been done with explicit NO-LOCK option)
hTable1:FIND-CURRENT (EXCLUSIVE-LOCK) .
这篇关于如何基于动态查询删除表中的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文