Using Prepared Statements to set Table Name

后端 未结 7 1909
生来不讨喜
生来不讨喜 2020-11-22 11:57

I\'m trying to use prepared statements to set a table name to select data from, but I keep getting an error when I execute the query.

The error and sample code is di

7条回答
  •  旧时难觅i
    2020-11-22 12:06

    I'm not sure you can use a PreparedStatement to specify the name of the table, just the value of some fields. Anyway, you could try the same query but, without the brackets:

    "SELECT plantID, edrman, plant, vaxnode FROM ?"
    

提交回复
热议问题