函数参考


_SQLite_QueryReset

重置 _SQLite_Query() 查询

#include <SQLite.au3>
_SQLite_QueryReset ( $hQuery )

参数

$hQuery SQLite_Query() 产生的查询句柄

返回值

成功: 返回 $SQLITE_OK
失败: 返回值可能违反 $SQLITE_* 常量
@error: -1 - SQLite 报告错误 (检查返回值)
1 - 错误调用 SQLite API 'sqlite3_reset'
2 - 调用被安全模式阻止

注意/说明

如果你想重新使用不同的参数执行相同的查询,这将重置查询,以便它准备再次执行.

相关

_SQLite_Query, _SQLite_QueryFinalize

示例/演示


#include <SQLite.au3>
#include <SQLite.dll.au3>

Local $hQuery, $aRow, $iSwitch
_SQLite_Startup()
ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
_SQLite_Open()
_SQLite_Exec(-1, "CREATE TABLE tblTest (a,b,c);")
_SQLite_Exec(-1, "INSERT INTO tblTest VALUES ('1','1','1');" & _ ; Row 1
        "INSERT INTO tblTest VALUES ('2','2','2');" & _ ; Row 2
        "INSERT INTO tblTest VALUES ('3','3','3');") ; Row 3
_SQLite_Query(-1, "SELECT RowID,* FROM tblTest;", $hQuery)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
    $iSwitch = MsgBox(4 + 64, "Row: " & $aRow[0], $aRow[1] & "," & $aRow[2] & "," & $aRow[3] & @LF & _
            "Continue Looping?")
    If $iSwitch = 6 Then ; Yes
        If $aRow[0] = 3 Then _SQLite_QueryReset($hQuery)
    Else ; No
        _SQLite_QueryFinalize($hQuery)
        ExitLoop
    EndIf
WEnd
_SQLite_Close()
_SQLite_Shutdown()