Page 1 of 1

Cannot use MySQL function in TMyCommand

Posted: Tue 23 Oct 2012 11:02
by mqamar007
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?

Re: Cannot use MySQL function in TMyCommand

Posted: Tue 23 Oct 2012 13:32
by AndreyZ
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)

Re: Cannot use MySQL function in TMyCommand

Posted: Thu 25 Oct 2012 05:16
by mqamar007
Thank you!

It was certainly a typo!

Re: Cannot use MySQL function in TMyCommand

Posted: Thu 25 Oct 2012 07:38
by AndreyZ
If any other questions come up, please contact us.