Forum > Database

MySQL Rename problem

(1/1)

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

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

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!

rvk:
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?

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

Thank you, I am searching  ;)

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


See also:

http://wiki.freepascal.org/SqlDBHowto#How_to_execute_direct_queries.2Fmake_a_table.3F

Navigation

[0] Message Index

Go to full version