Can I prepare "ALTER TABLE ? RENAME TO ?;" in SQLite?

30 views Asked by At

When trying to prepare statement ALTER TABLE ? RENAME TO ?; in SQLite 3.7.17 via DBD-SQLite-1.40 in order to upgrade the schema being used, I got an error message:

near "?": syntax error

So I wonder whether using $dbh->prepare() the reason for the "syntax" error?

1

There are 1 answers

0
U. Windl On BEST ANSWER

No, you cannot:

  1. Placeholders cannot be used for table and column names
  2. Commands manipulating the table structure (DDL) cannot be prepared.