I have a lot of text fields on a form. One of them is
txt_Recipe_Name. I can't find documentation through the Forum Search or anywhere else on how to use
parameters with
ExecuteDirect. I can use them with
SQLQuery but not with
ExecuteDirect. Is it possible to use
parameters with
ExecuteDirect? Or is there another way to accomplish an Insert on a table and be able to write my form data to the table fields?
This is what I have that I can't figure out how to make work:
SQLite3Connection1.ExecuteDirect('INSERT INTO recipe_names(name) VALUES(:r_name);');
How can I set
:r_name to a text field (TEdit field) on my form?
For a SELECT statement, this works nicely:
SQLQuery2.SQL.Text:='SELECT * FROM recipe_ingredients WHERE name_id = :id';
SQLQuery2.ParamByName('id').AsInteger:=SQLQuery1.FieldByName('name_id').AsInteger;
I use Prepared statements in PHP for all my MariaDB queries. But I can't find information on how to use them on databases within Lazarus. A wiki maybe?
In any case, my main concern is being able to use data on my form to
INSERT INTO an SQLite3 db. Anyone?