Replies: 5 comments
-
Looks like I needed to wrap the table name |
Beta Was this translation helpful? Give feedback.
-
So today I am trying again, this time, using back ticks, but on a new DB (Aurora Serverless MySQL) and the create table queyr is running, with no errors, but not creating the table. This is the output
|
Beta Was this translation helpful? Give feedback.
-
@paul-uz you can't use table name as a prepared statement parameter |
Beta Was this translation helpful? Give feedback.
-
Oh, why not? I'm not seeing any mention of this in the docs. |
Beta Was this translation helpful? Give feedback.
-
Its a mysql server / sql syntax restriction. also related: https://stackoverflow.com/questions/53233631/mysql-prepare-statement-is-it-possible-to-parametrize-column-name-or-function |
Beta Was this translation helpful? Give feedback.
-
I get an error for the following execute command
const table = await connection.execute('CREATE TABLE IF NOT EXISTS ? (? INT, ? VARCHAR(255))', ['news', 'id', 'title']);
If I hard code the table name etc, the statement is fine.
This is on Mysql 5.7 (on AWS Aurora RDS) but will probably change to the latest version of MySQL, esp if its a MySQL version issue....
Beta Was this translation helpful? Give feedback.
All reactions