How to avoid "cannot update this query type" ?
Moderators: gto, cipto_kh, EgonHugeist
How to avoid "cannot update this query type" ?
- DBMS: MySQL
- ZQuery.SQL is "select * from mytable limit 0,10"
When I do a ZQuery.Post through a TDBGrid and a TDatasource I get the error "cannot update this query type". I thought this error only raises when doing queries with joins or some aggregate-functions in it??
Regards,
Ansgar
- ZQuery.SQL is "select * from mytable limit 0,10"
When I do a ZQuery.Post through a TDBGrid and a TDatasource I get the error "cannot update this query type". I thought this error only raises when doing queries with joins or some aggregate-functions in it??
Regards,
Ansgar
Strange: sometimes i can update with LIMIT-queries and sometimes not. I have a slight idea that only tables with a primary key can be updated, because one table I cannot update has no PK and another with a PK can be updated...
By the way: the "ZQuery.WhereMode" is set to "wmWhereAll" - don't know if this is important but the other option "wmWhereKeyOnly" sounds as if one cannot update/delete tables without PK?
And BTW: is there a more detailed documentation of ZeosLIB available?
Regards,
Ansgar
By the way: the "ZQuery.WhereMode" is set to "wmWhereAll" - don't know if this is important but the other option "wmWhereKeyOnly" sounds as if one cannot update/delete tables without PK?
And BTW: is there a more detailed documentation of ZeosLIB available?
Regards,
Ansgar
Maybe I've found another situation that leads to this error. I have a similar problem when I want to post into a Temporary table. It has indexes.
I hope the developer to fix this issue as soon as possible, because I used to work with temporary tables in Zeos 5.x and now I have a quite serious problem..
...
If the fix is not just behind the corner then please address me to the solution - even a dirty one.![Razz :P](./images/smilies/icon_razz.gif)
I hope the developer to fix this issue as soon as possible, because I used to work with temporary tables in Zeos 5.x and now I have a quite serious problem..
![Crying or Very Sad :cry:](./images/smilies/icon_cry.gif)
If the fix is not just behind the corner then please address me to the solution - even a dirty one.
![Razz :P](./images/smilies/icon_razz.gif)
the problem i have is where name of table is for egzample:
Table NAme - two strings and nothing works :Q
and second problem:
strange as this could be this select
this works but ... thn query dont read all fields dont read for egzample geo , linestring, polygons ...
Table NAme - two strings and nothing works :Q
and second problem:
strange as this could be this select
Code: Select all
SELECT * from `TABLE_NAME`
could also cause the problem
remove the ` character and the problem is solved
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Trysho,
Do you have more details? Zippo's problem with the temporary tables is solved by a very recent patch to the code. If you get the svn version or the patch submitted in an other thread that's solved. If your query is something else, just tell us more. Versions of Zeos, delphi, mysql. Create of your table, the query...
Mark
Do you have more details? Zippo's problem with the temporary tables is solved by a very recent patch to the code. If you get the svn version or the patch submitted in an other thread that's solved. If your query is something else, just tell us more. Versions of Zeos, delphi, mysql. Create of your table, the query...
Mark
Yipieeee!!
Well ... it wasnt that bad ... i solve the problem ... was my fault, i just put ZQuery.Open instead ZQuery.ExecSQL and Append, Edit, Post and Cancel Methods work fine (until now) ...
im sorry for the details, i use a Borland Delphi 2006 with Zeos 6.5.1 alpha and MySQL 4.1. The issue was that if ZQuery its open with .Open method, ZQuery assumes the role of a table with the resultset, if i use the .ExecSQL method the Query its executed in MySQL, and the resultset becomes read only (ExecSQL is used only for update, delete and alter statements), so, i saw my data in the DBEdits but i cant do anything with append, edit or post, it just dont work.
With Open, the ZQuery accepts append, edit and post just as a ZTable do ...
im very happy, because my project works completely with this 3 methods, i hope this help somebody else. Thank you anyway.
im sorry for the details, i use a Borland Delphi 2006 with Zeos 6.5.1 alpha and MySQL 4.1. The issue was that if ZQuery its open with .Open method, ZQuery assumes the role of a table with the resultset, if i use the .ExecSQL method the Query its executed in MySQL, and the resultset becomes read only (ExecSQL is used only for update, delete and alter statements), so, i saw my data in the DBEdits but i cant do anything with append, edit or post, it just dont work.
With Open, the ZQuery accepts append, edit and post just as a ZTable do ...
im very happy, because my project works completely with this 3 methods, i hope this help somebody else. Thank you anyway.