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

AVEVA™ InTouch HMI

SQLRollback() 函数

  • Last UpdatedSep 24, 2024
  • 1 minute read

SQLRollback() 函数反转或回滚最新的事务集。事务集是在 SQLTransact()SQLCommit() 函数之间发出的一组命令。

事务集的处理方式与单个事务相同。SQLTransact() 函数运行之后,所有的后续操作都不会提交给数据库。SQLCommit() 函数运行之后,才发生对数据库的查询更改。如果在 SQLCommit() 函数之前运行 SQLRollback() 函数,则它可以回滚事务集。

类别

SQL

语法

[ResultCode=]SQLRollback(ConnectionID)

参数

ConnectionID

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

示例

本例回滚脚本中 SQLTransact 函数之前的数据库值。

ResultCode =SQLTransact(ConnectionID);

ResultCode = SQLInsertPrepare(ConnectionID, TableName, BindList, StatementID);

ResultCode = SQLInsertExecute(ConnectionID, BindList, StatementID);

ResultCode = SQLInsertEnd(ConnectionID, StatementID);

ResultCode =SQLRollback(ConnectionID);

另请参阅

SQLCommit()、SQLTransact()

In This Topic
Related Links