In general you use data binding in SQL statements to avoid SQL injection by adversaries. https://xkcd.com/327/
I've posted here a set of functions for binding for SQLite but that slows down things significantly, due to numerous use of DllCalls and glue code. Binding should be reserved for fast (compiled) languages like C, not slow (interpreted) like AutoIt.
Yet AutoIt + SQLite is more than enough for your use case.
That leaves you with building your SQLite statements with SQL parts and inlined values, mostly variables, of different types. You often have to escape strings (double single quotes in strings) using _SQLite_FastEscape() if you suspect they might someday contain '. Use _SQLite_FastEncode() for binaries. You also have to take care of enclosing strings in single quotes (double quotes are reserved for schema names like table or column names containing spaces or ") and insert commas between second and next arguments (i.e. in insert statements).
That makes typing statements a little painful. I personally use a set of little functions to make that much less error-prone.
To use that you need to remember that SQLite understands 4 basic datatypes which end up in only 3 here: Text, Int or Real (Numeric) and Hex.
The first literal parameter doesn't need a leading comma, but next ones do.
So the rules for using this set of functions is: for first parm, use single letter function with 1 appended, use single letter functions for subsequent parameters.
Consider the insert statement previously posted:
Local $StdStr = "INSERT INTO MeterReadings(Meter,Date,Time,Reading,Error) VALUES("
$sSQL = $StdStr & "1,'" & $Date & "','" & $Time & "',194.0,'Y');"
$Result = _SQLite_Exec(-1, $sSQL)
A single error in the mixup of " ' , results in an error. Hard to type when you have dozens of literal values of various types. I understand that your use case is simple, but anyway.
Here's the list of functions:
; for the first parameter only
Func N1($v)
Return (Number($v))
EndFunc ;==>N1
Func T1($v)
Return ("'" & StringReplace($v, "'", "''") & "'")
EndFunc ;==>T1
Func B1($v)
Return ("X'" & Hex($v) & "'")
EndFunc ;==>B1
; for subsequent parameters
Func N($v)
Return ("," & Number($v))
EndFunc ;==>N
Func T($v)
Return (",'" & StringReplace($v, "'", "''") & "'")
EndFunc ;==>T
Func B($v)
Return (",X'" & Hex($v) & "'")
EndFunc ;==>B
N1() and N() are for Numeric (int or real)
T1() and T() are for Text
B1() and B() are for Binary
N, T & B are very intuitive as type mnemonics and you just have to remember to use N1, T1 or B1 for the 1st parm.
Here's the same statement rewriten using them:
Local $StdStr = "INSERT INTO MeterReadings(Meter,Date,Time,Reading,Error) VALUES("
$sSQL = $StdStr & N1(1) & T($Date) & T($Time) & N(194.0) & T('Y') & ")"
$Result = _SQLite_Exec(-1, $sSQL)