M Mark Stuart Well-Known Member Licensed User Longtime User Jul 20, 2017 #1 I'm looking to get back a result that lets me know if a SQLite INSERT, UPDATE, or INSERT OR REPLACE was successful. I've used the ExecQuerySingleResult2 method, but so far returns NULL. Code: Copy Dim InfoID as String = "" InfoID = Main.SQLcn.ExecQuerySingleResult2("INSERT OR REPLACE INTO AppInfo (InfoID, LocCode, ScanYear, ScanPeriod) VALUES(1, ?, ?, ?)",Array As String(LocCode,ScanYear,ScanPeriod)) Any ideas will be welcome. Thanx, Mark S.
I'm looking to get back a result that lets me know if a SQLite INSERT, UPDATE, or INSERT OR REPLACE was successful. I've used the ExecQuerySingleResult2 method, but so far returns NULL. Code: Copy Dim InfoID as String = "" InfoID = Main.SQLcn.ExecQuerySingleResult2("INSERT OR REPLACE INTO AppInfo (InfoID, LocCode, ScanYear, ScanPeriod) VALUES(1, ?, ?, ?)",Array As String(LocCode,ScanYear,ScanPeriod)) Any ideas will be welcome. Thanx, Mark S.
Erel B4X founder Staff member Licensed User Longtime User Jul 20, 2017 #2 You should use ExecNonQuery for non-select commands. It will throw an exception if the command failed. Upvote 0
You should use ExecNonQuery for non-select commands. It will throw an exception if the command failed.