Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ InTouch HMI

SQLDelete() 函数

  • Last UpdatedSep 24, 2024
  • 1 minute read

SQLDelete() 函数从表中删除与 WhereExpr 参数指定的条件匹配的所有记录。

类别

SQL

语法

[ResultCode=]SQLDelete(ConnectionID, TableName, WhereExpr);

参数

ConnectionID

内存整型标记的名称,用于存放 SQLConnect() 函数指定给每个数据库连接的编号 (ID)。

TableName

要从中清除记录的表的名称。这些记录满足 WhereExpr 参数指定的条件。

WhereExpr

为表中的任一行定义的可以为真或为假的条件。SQLDelete() 函数仅会删除 WhereExpr 条件为 True 的记录行。表达式必须采用以下格式:

ColumnName comparison_operator 表达式

注意:SQLDelete() 函数不得包含空的 WhereExpr 参数。

示例

下面的语句删除 BATCH1 表中批号等于 65 的所有记录:

ResultCode=SQLDelete(ConnectionID,"BATCH1", "lotno=65");

注意:如果列的数据类型为字符,则必须使用英文单引号将表达式括起来,如 "MachineID='AG_LX7_2'"。

另请参阅

SQLConnect()

In This Topic