Hi,
I have a TzQuery like this:
Qry.Sql.Text: = 'select status from orders where no_orden ='' xxx'' ';
By performing these steps:
Qry.Edit;
Qry.FieldByName ('status'). AsString: = '5';
Qry.Post;
the query is executed on the MySQL database (activating the log) in this way:
UPDATE orders SET STATUS = '5' WHERE status = 1
?! How is this possible? I would have expected this parsing:
UPDATE orders SET STATUS = '5' where no_orden =' xxx '
I'm missing something or it may be an error of Zeos?
Thanks in advance.
[solved] Problem with TZquery
Re: Problem with TZquery
Hi,
no one can assume something about this topic?
no one can assume something about this topic?
Re: Problem with TZquery
@mrossij
Everything is fine.
You editing dataset(Qry) ie updating the record on which the cursor is.
Michal
Everything is fine.
You editing dataset(Qry) ie updating the record on which the cursor is.
Michal
Re: Problem with TZquery
Thank you very much for response Miab3, but I do not understand.
Is correct that this query:
'select status from orders where no_orden = '2' ';
that specifies a field n_orden into the where, when I run the post the update-query created by Zeos uses a WHERE changed?
For me this is not correct! It should not be modified the original query with:
where status = 1 ????
How does Zeos to radically change the original query in the update?
(Sorry for my bad english!)
Is correct that this query:
'select status from orders where no_orden = '2' ';
that specifies a field n_orden into the where, when I run the post the update-query created by Zeos uses a WHERE changed?
For me this is not correct! It should not be modified the original query with:
where status = 1 ????
How does Zeos to radically change the original query in the update?
(Sorry for my bad english!)
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Problem with TZquery
Zeos determines the selected table. For us it doesn't matter which "where"-clause you're using for.where status = 1 ????
How does Zeos to radically change the original query in the update?
I assume field "status" might be an index? Otherwise it's the only field which changed it's data. So Zeos builds it's own "where"-clause. See Logging-Info.
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Re: Problem with TZquery
Thank you so much EgonHugeist.
Thanks for the explanation.
In fact, I was given the same answer, although I was surprised me. Why not leave the 'where' clause as built ?. However, so is the implementation of Zeos and we have to accept it.
As always, give me a clear answer! . Thank you once again.
Bye.
Thanks for the explanation.
In fact, I was given the same answer, although I was surprised me. Why not leave the 'where' clause as built ?. However, so is the implementation of Zeos and we have to accept it.
As always, give me a clear answer! . Thank you once again.
Bye.
Re: Problem with TZquery
Excuse my forgetfulness: in fact 'status' is an index field.