What should look like the InsertSQL, UpdateSQL, DeleteSQL stat. for dbGrid? lazarus / 16-Databases ---------------------------------------------------------------------- Ronan · 2011-07-22 10:26 hi all As the subject tab implies, obviously that depends on what I'm trying to achieve, but generally speaking, assume that I'm using the dbGrid(or Navigator) components to view the records, if I try to manipulate the selected(active) row via dbGrid, what statement should be filled in UpdateSQL and DeleteSQL properties of SQLQuery component? Regards, ---------------------------------------------------------------------- Ronan · 2011-07-22 12:45 Regarding the "SqlDBHowto" documentation reveals that statement for UpdateSQL should be as below Code: [Select]"update TBLNAMES set NAME=Edited name' where ID=1;"Glitch here is, how to write update query for currently viewed record from dbGrid and change the exact same record, seems like a record value swapping but couldn't figured out to run it succesfully. Tried to keep the old values in parameter on entering the cell, Code: [Select]update combo_Result set Combo_Name = :new_name, multiplier = :new_multi where combo_name = :old_combo and multiplier = :old_multi But this time SQLQuery complains about that not found parameter, where I exactly know that I've created at design time. ---------------------------------------------------------------------- Lacak2 · 2011-08-01 08:34 You must use as parameter names same names as are field names (for old values use prefix "OLD_"), so in your case: Code: [Select]update combo_Result  set Combo_Name = :combo_name, multiplier = :multiplier  where combo_name = :OLD_combo_name and multiplier = :OLD_multiplier