Topic: Problem with SQLexecute WHERE statement
Being too clever for my own good.! I need to save an entry form to two different tables in the database.
So, I have used the inbuilt SAVE mechanism for one table and then in the 'after_click' event (which I'm using as a sort of trigger SQL) I have the follwoing code.
procedure frmMain_Button3_OnAfterClick (Sender: TObject);
var dbid: integer;
begin
dbid := frmMain.Button3.dbGeneralTableId;
sqlexecute('INSERT INTO productSupplier (supplier_part_number) VALUES ("'+frmMain.edtSupplierCode.text+'") WHERE ID = '+IntToStr(dbid));
sqlexecute('INSERT INTO productSupplier (description)VALUES ("'+frmMain.edtDeascription.text+'") WHERE ID = '+IntToStr(dbid)+')');
//sqlexecute('INSERT INTO productSupplier (notes)VALUES ("'+frmMain.memPartNotes+'") WHERE ID = ("'+dbid+'")');
end;
Neither format of the SQL statement works as shown above - I get a 'NEAR WHERE' error message.
Ignore the image box picture, I got fed up searching for the correct picture so just selected the first one I came to on my PC.