Executes a SQLite query, does not handle results
#include <SQLite.au3>
_SQLite_Exec ( $hDB, $sSQL [, $sCallBack = ""] )
The Callback function must accept 1 parameter and can return $SQLITE_ABORT to stop processing (See example).
The first row in the Callback sequence will be the column names.
_SQLite_GetTable, _SQLite_GetTable2D, _SQLite_Query
#include <SQLite.au3>
#include <SQLite.dll.au3>
Local $hQuery
_SQLite_Startup ()
If @error Then
MsgBox ($MB_SYSTEMMODAL,"SQLite Error","SQLite3.dll Can't be Loaded!")
Exit - 1
EndIf
ConsoleWrite ("_SQLite_LibVersion="&_SQLite_LibVersion ()&@CRLF )
_SQLite_Open ()
; Without $sCallback it's a resultless statement
_SQLite_Exec (-1,"Create table tblTest (a,b int,c single not null);"&_
"Insert into tblTest values ('1',2,3);"&_
"Insert into tblTest values (Null,5,6);")
Local $d= _SQLite_Exec (-1,"Select rowid,* From tblTest","_cb"); _cb will be called for each row
_SQLite_Close ()
_SQLite_Shutdown ()
; Output:
;rowid a b c
; 1 1 2 3
; 2 5 6
Func _cb($aResult)
For $sIn $aResult
ConsoleWrite ($s&@TAB )
Next
ConsoleWrite (@CRLF )
; Return $SQLITE_ABORT ; Would Abort the process and trigger an @error in _SQLite_Exec()
EndFunc ;==>_cb