Cannot use MySQL function in TMyCommand

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mqamar007
Posts: 2
Joined: Tue 23 Oct 2012 10:46

Cannot use MySQL function in TMyCommand

Post by mqamar007 » Tue 23 Oct 2012 11:02

Hello,

I am trying to use TMyCommand component in MyDAC 5.80 in Delphi 7 to execute the following query:

UPDATE Emp
SET
Password = PASSWORD(:Password)
WHERE
id = :Old_id AND Password = PASSW0RD(:Old_Password)

But the parser would give the error:

#42000 Function <mydbname>.PASSWORD does not exist.

What should I do?

AndreyZ

Re: Cannot use MySQL function in TMyCommand

Post by AndreyZ » Tue 23 Oct 2012 13:32

Hello,

You made a misprint in your SQL code, you typed the zero symbol '0' instead of the 'O' symbol. Here is a correct code:

Code: Select all

UPDATE Emp
SET
 Password = PASSWORD(:Password)
WHERE
 id = :Old_id AND Password = PASSWORD(:Old_Password)

mqamar007
Posts: 2
Joined: Tue 23 Oct 2012 10:46

Re: Cannot use MySQL function in TMyCommand

Post by mqamar007 » Thu 25 Oct 2012 05:16

Thank you!

It was certainly a typo!

AndreyZ

Re: Cannot use MySQL function in TMyCommand

Post by AndreyZ » Thu 25 Oct 2012 07:38

If any other questions come up, please contact us.

Post Reply