I try to use TZQuery and TZUpdateSQL with lazarus and it gives me headache.
the situation is : a datamodule with TZquery and TZUpdateSQL
TZQuery.UpdateObject is set to TZUpdateSQL component
TZQuery have a select query
Code: Select all
SELECT libelle, CodeCIP FROM t0
Code: Select all
INSERT INTO t0 (article_id, Libelle, CodeCIP) VALUES (:article_id, :Libelle, :CodeCIP)
Code: Select all
query.Insert;
query.paramByName('article_id').asInteger := FarticleId;
query.paramByName('Libelle').asString := EditLibelle.Text;
query.paramByName('CodeCIP').asString := EditCodeCIP.Text;
query.post
So I try another method
Code: Select all
query.Insert;
update.Params.paramByName('article_id').asInteger := FarticleId;
update.Params.paramByName('Libelle').asString := EditLibelle.Text;
update.Params.paramByName('CodeCIP').asString := EditCodeCIP.Text;
query.post
What am I missing !!! (i'm sure component is not buggy, just not documented !!)
regards
PS : article_id is not the primary key