Page 1 of 1
"Unknown column "concat(r.ime,' ',r,prezime)" in where clause"
Posted: Fri 09 Nov 2007 08:48
by vortex77
Hello,
I've stumbled at problem that I just cant get my mind around.
This is the query :
select r.*,
CONCAT(r.ime,' ',r.prezime),
vk.nazivk
from mkrodjeni r,
vrstek vk
where
r.sifops = :so AND
r.kljuc = :k AND
vk.brknjige = r.brknjige
Query needs to read and write new and modified data with prior locking.
Everything work fine until I call external "order by" (from TGrid).
When I try to call MyQuery1.Lock(lrImmediately) I get message :
"Unknown column "concat(r.ime,' ',r,prezime)" in where clause"
This happens with any and all queries with concat statement.
Please help!!!
ps. I work with Delphi7 and MyDAC 5.20.0.11
Posted: Fri 09 Nov 2007 14:20
by Antaeus
Most likely that your mkrodjeni table does not contain a primary key. Try to define a primary key in mkrodjeni.
Posted: Mon 12 Nov 2007 07:35
by vortex77
No, it has a primary key, foreign keys and all normalizations are done.
Error comes only after I implicitly add "order by" clause in query with
Query.SetOrderBy(Field); // Field = "r.ime" from example
Query.SQL.Add(OrderBy); // OrderBy can be "asc" or "desc"
Query.Execute;
After I reset query.Sql everything work fine....
Posted: Mon 12 Nov 2007 08:56
by vortex77
Ok...
Ive tested application a bit more and this is what I came to:
1) If I have CONCAT and ORDER BY in query and call LOCK - Error shows.
2) If I have CONCAT without ORDER BY - Lock works fine
3) If I have ORDER BY without CONCAT - Lock works fine.
Did I misunderstand Lock command or is this a bug?
Posted: Wed 14 Nov 2007 14:10
by Antaeus
I could not reproduce the problem.
Please send me a complete small sample at mydac*crlab*com to demonstrate it, including script to create and fill table.
Also supply me the following information:
- exact version of MyDAC. You can see it in the About sheet of TMyConnection Editor;
- exact version of your IDE;
- exact version of MySQL server and MySQL client. You can see it in the Info sheet of TMyConnection Editor.
Posted: Thu 15 Nov 2007 12:19
by vortex77
I've just send test application (full source code and compiled exe)
to demonstrate error, along with sql file with complete data and definitions.
Hope this will help.
Posted: Fri 16 Nov 2007 14:58
by Antaeus
Thank you for your example. Please download MyDAC 5.20.0.12 from our site. It should fix this problem.
Posted: Mon 19 Nov 2007 08:04
by vortex77
I have downloaded latest version, but problem remains!
Not even test application worked.
The error is still here.
Please help,coz I need to resolve this problem quickly due to clients deadline.
Posted: Tue 20 Nov 2007 10:45
by Antaeus
Thanks you for information. It looks like this problem has not been fixed completely.
Please send me your registration information by e-mail.
Posted: Wed 21 Nov 2007 11:45
by vortex77
License info has been send to your e mail.
Hope this helps us solve this problem
Posted: Wed 21 Nov 2007 13:39
by Antaeus
We have checked your license. You have access to MyDAC sources. So I have sent you instructions on how to change the source code to fix this problem. Please check the e-mail address you used for MyDAC registration.