Forum > Database

MySQL Rename problem


DROP,SELECT,INSERT are working. But when I want:

  FormZadavani.Query.SQL.Text := 'RENAME TABLE vyr1  TO vyr1old, vyr1new TO vyr1';

command ExecSQL never ends, unless I stopped debugging. After that RENAME is done.
(Problem is not that I rename 2 tables in one command, with only one table to rename is the problem the same.)

Maybe I forgot something? Thank you very much for help!

Which MySQL version are you using? The latest?

Also, there can't be any transactions active when issuing a rename command.
Are you absolutely sure this is the first command you use after making the connection with the database. And are you also absolutely sure nobody else (or machine) is using the database at the moment?

you must be true, when I move this rename piece of code to a standalone application it works.

Thank you, I am searching  ;)

Use executedirect for DDL/tables manipulation. This doesn't parse the SQL in sqldb internally.

See also:


[0] Message Index

Go to full version