[SOLVED] SQLite Can't UPDATE lazarus / 16-Databases ---------------------------------------------------------------------- pcurtis · 2020-07-29 11:12 Why doesn't this give any errors? (Can't find Param1 ...) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);var  sSQL : string;begin  sSQL := ' UPDATE tnTEST' +          ' SET' +          ' fnTEST = :Param1' +        ' WHERE fnIDX = :Param2';   SQLQuery1.DataBase := SQLConnector1;  SQLQuery1.SQL.Clear;  SQLQuery1.SQL.Add(sSQL);   SQLQuery1.ExecSQL; <* Should throw an error hereend; ---------------------------------------------------------------------- six1 · 2020-07-29 11:28 You've to define the Parameters i.e.: SQLQuery1.SQL.Parambyname('Param1').asstring:= ..... SQLQuery1.SQL.Parambyname('Param2').asstring:= ..... ---------------------------------------------------------------------- PascalDragon · 2020-07-29 11:31 Quote from: six1 on July 29, 2020, 01:28:56 pmYou've to define the Parameters i.e.: SQLQuery1.SQL.Parambyname('Param1').asstring:= ..... SQLQuery1.SQL.Parambyname('Param2').asstring:= ..... pcurtis seems to know what the problem is. Their question was why there is no error if no parameters are set. ---------------------------------------------------------------------- pcurtis · 2020-07-29 11:39 Yes "Why there is NO error" Or the main problem is when I specify the correct parameters SQLQuery1.SQL.Parambyname('Param1').asinteger:= 100 SQLQuery1.SQL.Parambyname('Param2').asinteger:= 1  the table isn't updated. (And yes there is a row where fnIDX = 1) ---------------------------------------------------------------------- shadow · 2020-07-29 11:45 I guess Param1 and Param2 are being interpreted as NULL if you don't assign an explicit value. ---------------------------------------------------------------------- pcurtis · 2020-07-29 11:48 See above comment (And ParamCheck := true) ---------------------------------------------------------------------- korba812 · 2020-07-29 13:06 ParamCheck property does not mean that the parameters will be checked for null value. https://www.freepascal.org/docs- html/current/fcl/sqldb/tsqlquery.paramcheck.html Besides, null value is also a valid value for the parameter. You probably aren't committing the transaction after execution and therefore the data isn't updated in the table. ---------------------------------------------------------------------- pcurtis · 2020-07-29 16:43 Problem solved - the database was corrupt, and needed repairing. But I still think it should throw an error when a parameter is missing (Take ZEOS for example)